Probly a stupid little mistake

closed account (zN0pX9L8)
I'm trying to make 2 collumns ( I know it's spelled wrong), one starting at 0 and the other starting at 10, then they will stop at the starting number of the other collumn. this is what I have so far.

//---------------------------------------------------------------------------
#include <vcl.h>
#include <cstring>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
#include <math.h>
#include <iostream.h>
#include <ctime>

//---------------------------------------------------------------------------

int i = 0;

//---------------------------------------------------------------------------

#pragma argsused
int main()
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), LIGHTGREEN);
for ( int i = 0; i < 10; i++ ) {
for (int t =10; t > 0; t--){
cout<< i << " " << t << endl;
}
}
cin.get();
}


What am I doing wrong?


Im a big noob, with a big dick
Last edited on
You do not have to define int i = 0 before the for loop, since it is defined in the loop. Your loop is also incorrect, as it would print out:

0 10
0 9
...
1 10
1 9

Unless that is what you want...
Topic archived. No new replies allowed.