2005 Delhi:
1.d) Find the output of the following program:
#include<iostream.h>
struct MyBox
{ int Length,Breadth,Height;
};
void Dimension(MyBox M)
{ cout<<M.Length<<”x”<<M.Breadth<<”x” ;
cout<<M.Height<<endl;
}
void main( )
{ MyBox B1={10,15,5},B2,B3;
++B1.Height;
Dimension(B1);B3=B1;
++B3.Length;
B3.Breadth++;
Dimension(B3);
B2=B3;
B2.Height+=5;
B2.Length--;
Dimension(B2);
}
2005 Outside Delhi:
1.d) Find the output of the following program:
#include<iostream.h>
struct Package
{ int Length,Breadth,Height; };
void Occupies(Package M)
{ cout<<M.Length<<”x”<<M.Breadth<<”x” ;
cout<<M.Height<<endl;
}
void main( )
{ Package P1={100,150,50},P2,P3;
++P1.Height;
Occupies(P1);
P3=P1;
++P3.Lengh;
P3.Breadth++;
Occupies(P3);
P2=P3;
P2.Height+=50;
P2.Length--;
Occupies(P2);}
CBSE Computer Science Solved Revision Tour By Mr. Ravi Kiran ( [email protected] )