C output type question

Q.  C programming : Trace the output

While(“%d” , printf(“abc”))
    {
Printf(“de”);
    }

- Published on 22 Jun 15

a. abcdeabcdeabcde……………
b. abdededede…………………
c. Compile error.
d. None of the above.

ANSWER: abcdeabcdeabcde……………
 

    Discussion

  • vishal   -Posted on 29 Aug 18
    while loop condition will execute infinitely hence it prints abc and then enters the loop and print de.and goes on.....

Post your comment / Share knowledge


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)