1. What will be the output of following code.
(#include<iostream>
using namespace std;
int main()
{
int matrix
[6][4]={{1,2,3,4},{4,5,6,7},{8,9,10,11},{12,12,14,15},
{16,17,18,19},{20,21,22,23}};
for (int i=0; i<6, i++)
cout<< matrix [i][1]<<"\t"
return 0;
})
2. What is the output of following code:
(#include<iostream>
using namespace std;
int main()
{
int i=1;
i=i-1;
while (i)
{ cout<<"its a while loop";
i++;
}
return 0;
})
3.What is the first parameter of stream insertion (<<) and stream extraction (>>) operators?
4.Write a function definition which takes three arguments, retail price, sales tax, income tax and returns the Net price of a book.
Note: the net price of the book can be calculated by the formula
Net price= retail price + sales tax+ income tax.
5.Suppose a program has a math class having only data members “numbers”
Write the declaration and definition of a operator function
to overloaded + operator for the
statements of main function
Math obj1, obj2
Obj2= 10 + obj1
0 Comments