Homework help needed

The question is Create a counting program that counts backward from 100 to 1
in increments of 10.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <iostream>
using namespace std; 
int main()
 { 
int num = 1; 
while (num<100) { 
cout <<num<<"\n"; 
num=(num+10); 
} 
return 1; 
} 	   
  	
  
  


It seems there are some errors.
you are counting backwards so why are you adding 10 on line 8?
and why initialise your number to 1 when you want to start at 100?
Last edited on
Topic archived. No new replies allowed.