Answer to Question #74495 in C for Sushmaswaraj Udatha
#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 ??
1
2018-03-13T08:47:23-0400
#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;
}
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!
Learn more about our help with Assignments:
C
Comments
Leave a comment