What would the output of following c program example

What would the output of following c program example

#include<stdio.h>
int main()
{
   int n;
   for(n = 7; n!=0; n--)
     printf("n = %d", n--);
   getchar();
   return 0;
}
Asked on January 11, 2020 in program.
Add Comment
1 Answer(s)

Above program goes in infinite loop because n is never zero when loop condition (n != 0) is checked.

Answered on January 11, 2020.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.