ExamVeda
Login
Home
This question belongs to C Program Control Structures
Control Structures
?

What will be the output of given program?
#include<stdio.h>
void main()
{
	int a=3;
	for(;a;printf("%d ", a--);
}

Answer & Solution
Correct Answer: Option C

Decrement operator in for loop statement are executed until the condition is true.
So it is executed till "a" not equal to zero and printf statement inside for loop print a value of "a"

Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.