i would like help making a little piece of code that just counts down from a number, example 30 to 0. the program shouldnt display the previous numbers counted. thats it, any hel-p would be great.
brock.holman.7 0 Newbie Poster
Recommended Answers
Jump to PostPost the code you have written so that someone can help you. You will need to know about loops.
Jump to Postthe program shouldnt display the previous numbers counted.
Do I take this to mean that there should be no output? Or should there be a countdown from 30 to 0, with a delay in between each iteration, then there is a "Screen Clear" and the new number is …
Jump to PostYou don't have to clear the screen, just move the cursor back to the beginning of the line
cout << "\r" << number;
That will work only if you want to print the number at the beginning of the line.
All 9 Replies
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
tinstaafl 1,176 Posting Maven
brock.holman.7 0 Newbie Poster
VernonDozier 2,218 Posting Expert Featured Poster
brock.holman.7 commented: thankyou i think this is what i need ill be talk more when i have put it into my current code +0
brock.holman.7 0 Newbie Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Lucaci Andrew 140 Za s|n
VernonDozier 2,218 Posting Expert Featured Poster
Gonbe 32 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.