Multiple choice

Which of the following statements is correct about the program given below? #include void main() { int i=0; i++' If(i<=3) { printf(“I am the best”); exit();main(); } }

  1. <span style="font-size:11.0pt;line-height:115%;font-family:"Calibri","sans-serif";mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-bidi-font-family:"Times" new="">The program prints 'I am the best' three times.

  2. <span style="font-size:11.0pt;line-height:115%;font-family:Calibri,sans-serif;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-bidi-font-family:Times" new="">The program prints 'I am the best' infinite times.

  3. <span style="font-size:11.0pt;line-height:115%;font-family:Calibri,sans-serif;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-bidi-font-family:Times" new="">The program prints 'I am the best' only once.

  4. <span style="font-size:11.0pt;line-height:115%;font-family:Calibri,sans-serif;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-bidi-font-family:Times" new="">The compiler reports an error since main() cannot call itself.

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

This option is correct because when the compiler prints 'I am the best' for the very first time, it subsequently reads exit() and the program execution comes to an end. Hence, the statement will be printed only once.