Solution for Exercise 9-7
ex0907
#include <stdio.h>
int main()
{
int backwards;
for(backwards=25;backwards>=0;backwards=backwards-1)
{
printf("%d\n",backwards);
}
return(0);
}
Notes
* Line 7 is the one to get correct, regardless of whether you used the variable name backwards or not.
* You could have specified backwards>-1 as the second condition in the for statement. As long as zero is the final value displayed, the loop is correct.
Copyright © 1997-2025 by QPBC.
All rights reserved
