Programming Languages C Objective
Mar 08, 2013

What will be output of the following c code?
void main()
 {
  int x;
  for(x=1;x<=5;x++);
    printf("%d",x);
 }

Choose the correct answer:
A) 4
B) 5
C) 6
D) 7
Detailed Explanation

Body of for loop is optional. In this question for loop will execute until value of variable x became six and condition became false.

Discussion (0)

No comments yet. Be the first to share your thoughts!

Share Your Thoughts
Feedback