Multiple choice technology programming languages

main() { int a=0; if(a==0) printf(“Cisco Systemsn”); printf(“Cisco Systemsn”); }

  1. Two lines with “Cisco Systems” will be printed.

  2. Compile error

  3. run time error

  4. Cisco Systemsn

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

The code has an if statement that only affects the first printf call. The second printf is outside the if block, so it executes regardless of the condition. Since if(a==0) is true, the first printf executes and prints 'Cisco Systems', then the second printf also executes and prints another line with 'Cisco Systems', resulting in two identical lines.