Gate CS-2015-2 Question Paper With Solutions

Q. 27 Consider the following function written the C programming language.

void foo (char *a)  {    if (*a && *a != ` `)    {       foo(a+1);       putchar(*a);    }  } 

The output of the above function on input “ABCD EFGH” is

(A) ABCD EFGH

(B) ABCD

(C) HGFE DCBA

(D) DCBA

Answer: (D)

Explanation:

Gate CS-2015-2 Question Paper With Solutions Gate CS-2015-2 Question Paper With Solutions Gate CS-2015-2 Question Paper With Solutions

Learn More:   Gate EC-2010 Question Paper With Solutions

LEAVE A REPLY

Please enter your comment!
Please enter your name here