Multiple choice technology programming languages

for (printf("a");printf("b");printf("c")) { break; } What will be the output of the above code snippet?

  1. ab

  2. abc

  3. c

  4. none of the above

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

In the loop initialization, printf("a") executes and prints 'a'. Next, the condition printf("b") executes, prints 'b', and returns a non-zero value (true). The loop body then runs, executing break immediately. The loop terminates before the increment step, resulting in 'ab'.