Discussion :: Control Structures
-
What will be the output of given program?
#include<stdio.h>
void main()
{
int a=3;
for(;a;printf("%d ", a--);
}
Answer : Option C
Explanation :
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"
Be The First To Comment