Professional Documents
Culture Documents
Function Prototyping, Function Definition, Function Call
Function Prototyping, Function Definition, Function Call
Function Prototyping, Function Definition, Function Call
Function Call
1. What output is produced by the segment of code shown below:
void main( ){
cout << "W";
p( );
cout << "Z";
}
void p( ){
cout << "X";
cout << "Y";
}
2. What output is produced by the segment of code shown below?
void main( ){
cout << "TAKE";
p2( ); cout << "LEAD";
}
void p2( ){
cout << "THE";
}
3. What output is produced by the segment of code shown below?
void main( ){
cout << "TAKE";
p2( ); p2( ); cout << "LEAD";
p2( );
}
void p2( ){
cout << "THE";
}
4. What output is produced by the segment of code shown below?
void main( ){
cout << "BOBO";
p3( );
cout << "MELON";
p2( );
}
void p1( ){
cout << "IS";
}
void p2( ){
cout << "HEAD";
}
void p3( ){
p1( );
cout << "A";
}
5. What output is produced by the code segment below?
void main( ){
cout << "B";
p( );
cout << "C";
}
void p( ){
cout << "A";
p( );
}
6. What output is produced by the segment of code shown below?
void main( ){
int x;
x = p(4);
cout << x;
}
int p(int Temp){
return Temp + 3;
}
7. What output is produced by the segment of code shown below:
void main( ){
int z = 6;
int x = p(z);
cout << x;
}
int p(int Temp){
cout <<"B";
return Temp + 3;
}