Answer to Question #70886 in C for Prabhat

Question #70886
#include<stdio.h>
int main ()
{
int n;
for(n=7;n!=0;n--)
printf("n= %d",n--);
return 0;
}





Kindly explain it's output...
1
Expert's answer
2017-11-05T05:21:07-0500
This program will work infinitely, and it will output reducing values with step -2 from 7 till -2147483647 after that it will output reducing values from 2147483647 till -2147483647 infinitely.
All this happends due to unreachable condition of the loop finish using step -2 with passing 0 value (7, 5, 3, 1, -1, -3, ...).

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS