Multiple choice technology programming languages

void main(){ print(“%d”,printf(“What this prints”)) };

  1. Compile error

  2. What this prints

  3. 11

  4. 15

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

The inner printf("What this prints") returns 15 (length of the string) and prints the string. The outer printf prints this return value. So output is "What this prints15" but the printf returns 15, which the outer printf formats as %d, so final output is 15.