Number counting up to infinite .

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <windows.h>

int main()


 {
          int i;
          int y=6;
          int x=9;
          gotoxy(x,y);
//gotoxy(x,y) must be the coordinate that the number lies in.
          for(i=0;i>1;i++){
                            printf("%d",i);
                            }
          
          getch();
          }
int gotoxy(int x,int y)
{COORD coord = {x,y};
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),coord);
}


//how to make this program that the output is a number
that counts up to infinite (or we say just like a timer but there's no minute just all whole number counting up ) using for loop ? and when the number changes it also change in color !
and the color of a number is according to the color attribute of console output.

I just need help because i'm a newbie.
Last edited on
@zsmash

Take a look at an answer I gave to another.

http://www.cplusplus.com/forum/general/120768/

Run it, and you'll see around 240 lines of text, each with a different color text and background. Maybe that is what you were after..

your for loop will never execute. Considering 0 is less than 1. Also a signed integer goes from ~-billion -> ~2billion.
Topic archived. No new replies allowed.