Mega Code Archive
For loop backward
#include
int main(void)
{
long sum = 0L;
int count = 10;
int i;
for (i = count ; i >= 1 ; sum += i-- );
printf("\nTotal of the first %d numbers is %ld\n", count, sum);
return 0;
}
Total of the first 10 numbers is 55