# Answer to Question #74495 in C for Sushmaswaraj Udatha

Question #74495

#include<stdio.h>

int main()

{

int n;

for(n = 7; n!=0; n--)

printf("n = %d", n--);

getchar();

return 0;

}

anyone tell the o/p ??

int main()

{

int n;

for(n = 7; n!=0; n--)

printf("n = %d", n--);

getchar();

return 0;

}

anyone tell the o/p ??

Expert's answer

#include <stdio.h>

int main()

{

int n; // declare the variable

// this is the infinity loop because n will never be 0

/*for(n = 7; n != 0; n--)

printf("n = %d", n--);*/

// the right code is next:

// now we check is the n greater than 0

for(n = 7; n >= 0; n--)

printf("n = %d\n", n--);

// wait for the input from user

getchar();

return 0;

}

int main()

{

int n; // declare the variable

// this is the infinity loop because n will never be 0

/*for(n = 7; n != 0; n--)

printf("n = %d", n--);*/

// the right code is next:

// now we check is the n greater than 0

for(n = 7; n >= 0; n--)

printf("n = %d\n", n--);

// wait for the input from user

getchar();

return 0;

}

Need a fast expert's response?

Submit orderand get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

## Comments

## Leave a comment