C Programming MCQ

1:

Consider the following program.
main()
{
putchar ( 'M' );
   first();
   putchar ( 'm');
}
first ( )
{ _____ }
second ( )
{
putchar ( 'd');
}


If Madam is the required output, then the body of first ( ) must be

A.

empty

B.

second( ) ; putchar ( 'a' );

C.

 putchar( 'a' ) ; second(); printf ("%c", 'a' );

D.

none of the above

 

Answer : C

Explanation :

Since madam is the required output. the function first( ) . should print ' a ' call the function second ( ) that prints the 'd' and print ' a ' again. Hence c is the correct answer.

Write your comments here:


Report Error
 

Option: A

Explanation : Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here.