Question discussion

What will be the output of the following C code?

359470Medium DSSSB TGT Computer Science 0 replies 0 views
0
What will be the output of the following C code?
#include <stdio.h>
void main() {
    printf("%d", printf("Tata Consultancy"));
}
  • ATata Consultancy
  • BTata Consultancy15
  • CTata Consultancy16
  • D15Tata Consultancy
Correct answer: C

Explanation

The inner printf prints "Tata Consultancy" (16 characters) and returns 16, which the outer printf prints. The output is "Tata Consultancy16".

Discussion 0

Nobody has replied yet. Start the discussion!