Question discussion

What is the output of the following code?

358828Medium DSSSB TGT Computer Science 0 replies 0 views
0
What is the output of the following code?
#include <stdio.h>
int main() {
    printf("%d", printf("C Programming"));
    return 0;
}
  • A13
  • BC Programming
  • CC Programming12
  • DC Programming13
Correct answer: D

Explanation

The inner printf prints "C Programming" and returns the number of characters printed, which is 13. The outer printf then prints 13, so the output is C Programming13.

Discussion 0

Nobody has replied yet. Start the discussion!