COMPUTER SCIENCE STRUCTURES

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 ( mrkdata@yahoo.com )


Warning: include_once(../../ebooks-footer19.php): Failed to open stream: No such file or directory in /home/cbseguess/public_html/ebooks/xii/coumputer-science/structure4.php on line 120

Warning: include_once(): Failed opening '../../ebooks-footer19.php' for inclusion (include_path='.:/opt/cpanel/ea-php83/root/usr/share/pear') in /home/cbseguess/public_html/ebooks/xii/coumputer-science/structure4.php on line 120

Warning: include_once(../../../footer19.php): Failed to open stream: No such file or directory in /home/cbseguess/public_html/ebooks/xii/coumputer-science/structure4.php on line 122

Warning: include_once(): Failed opening '../../../footer19.php' for inclusion (include_path='.:/opt/cpanel/ea-php83/root/usr/share/pear') in /home/cbseguess/public_html/ebooks/xii/coumputer-science/structure4.php on line 122