Question { 4925 }
Sir,please help me out with the output of this programme:-
#include
#include
void main()
{
int a=18,b=12,i;
for(i=a
printf("%d %d",i);
}
Answer
Check how loop runs
At start of the loop for (I = 12; (18 % 12 || 12 % 12); i--)
1 ieteration (6 || 0) and i = 11
1 ieteration (7 || 1) and i = 10
1 ieteration (0 || 3) and i = 9
1 ieteration ( 2|| 4) and i = 8
1 ieteration (4 || 5) and i = 7
1 ieteration (0 || 0) and i = 6 Loop comes out then the
value of I prited is 6