reverse and alternate counting of numbers PROGRAM in for loop C++

this is the output

8 1 7 2 6 3 5 4 4 5 3 6 2 7 1 8

that's the output...can you please help me thanks
try something yourself first
ah i see... i'll trying it..but it counting backward only.. :(


#include
using namespace std;

void main()
{

int i;
for(i=10; i > -1; i--)

system("pause");
return 0;

}
i'm not expert for this loop :(
Hint

The first time through the loop, output 8 and 1.
The second time through the loop, output 7 and 2.
The third time through the loop, output 6 and 3.

jsmith wrote:
Hint

The first time through the loop, output 8 and 1.
The second time through the loop, output 7 and 2.
The third time through the loop, output 6 and 3.

Hint:
9 - 8 = 1
9 - 7 = 2
9 - 6 = 3
how??? :(
Topic archived. No new replies allowed.