31. | #incude |
|||||||
|
32. | void main() {
int a=1,b=5,c;
clrscr();
c=operation(a,b);
printf("%d",c);
getch();
}
int operation(int a,int b)
{
int c;
c=++a * ++a * b++;
return c;
}
*a=*b;
*b=*temp;
}
|
|||||||
|
33. | void swap(int,int);
void main()
{
int a=10,b=15;
clrscr();
printf("Befor swap a=%d ,b=%d",a,b);
swap(a,b);
printf("\nAfter swap a=%d ,b=%d",a,b);
getch();
}
void swap(int a,int b)
{
int c;
c=a;
a=b;
b=c;
}
|
|||||||
|
34. | #include |
|||||||
|
35. | What is the output of this program? #include
using namespace std;
class Box
{
double width;
public:
friend void printWidth( Box box );
void setWidth( double wid );
};
void Box::setWidth( double wid )
{
width = wid;
}
void printWidth( Box box )
{
box.width = box.width * 2;
cout << "Width of box : " << box.width << endl;
}
int main( )
{
Box box;
box.setWidth(10.0);
printWidth( box );
return 0;
}
|
|||||||
|
36. | What will be output if you will compile and execute the following c code? void main(){
int a=10;
printf("%d %d %d",a,a++,++a);
}
|
|||||||
|
« previous
1
2
3
4
5
6
7
8
9
...next »