A

Admin • 833K Points
Coach

Q. What is the output of this program?

Code:
#include <stdio.h>
int main()
{
int i;
for (i = 0;i < 5; i++)
int a = i;
printf("%d", a);
}
  • (A) a is out of scope when printf is called
  • (B) Redeclaration of a in same scope throws error
  • (C) No errors, program will show the output 5
  • (D) Syntax error in declaration of a
  • Correct Answer - Option(D)
  • Views: 18
  • Filed under category C Programming
  • Hashtags:

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.