?
What will be the output of given program?
What will be the output of given program?
#include<stdio.h>
void main()
{
int a=3;
for(;a;printf("%d ", a--);
}
#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"
Join the Discussion
Login to post a comment or share your explanation.
Login