automatic changing the values in console?

my output sud b a name(like john smith:age) & his age should change automatically ( 10 times,startin wid 10 ending wid 20),every second/every minute ,& after 10 changes it has to stop,IN V C++ can anybody help me with the code?


eg: john smith: 10(after one second/one minute)
john smith: 11 " "
|
|
|
|
|
|
john smith: 20 (stop)
Add #include <windows.h> at the top of your program. In a for loop, int age=10;age<=20;age++, have a Sleep(1000) for 1 sec, or Sleep(60000) for 1 minute. When printing out age, it'll increase after the sleep cycles
closed account (o3hC5Di1)
Hi there,

Here are some tips to look on this site or google for:

- The sleep() function (for the time aspect of the program)
- cout (for printing the text to the screen in a console app)

Hope that gets you on your way.

All the best

NwN

PS: You might want to check the forum guideline regarding spelling :)
Topic archived. No new replies allowed.