Thread: Count Down

  1. #1
    Unregistered
    Guest

    Question Count Down

    i was wondering if someone knew an effective way to make a program that is able to count down but does not fill the screen. i would hope it to look like this.


    Percent Complete: 12% (and I would wish that only the digit changes) if anyone could drop me a hint on how it would work i'd appreciate it

  2. #2
    Unregistered
    Guest

    Here's how

    you can use gotoxy(x, y)
    to print the text at a particular point everytime...

    keep the x, y coordinates the same and it will print at
    the same spot.

    Hope this helps.

    http://mahurshi.tripod.com/mainframes.htm

  3. #3
    Registered User
    Join Date
    Jan 2002
    Posts
    387
    Code:
    #include <windows.h>
    #include <cstdlib>
    #include <iostream>
    using namespace std;
    
    int main(int argc, char *argv[])
    {
        for(int i = 0; i <= 100; i++)
        {
            cout << i << "% Completed";
            Sleep(500);
            system("CLS"); // clear the screen after 500 milliseconds
        }
        cout << "\nInstallation Complete";
        return 0;
    }
    something like that
    "There are three kinds of people in the world...
    Those that can count and those that can't."

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. bintree and count (withouth using template)?
    By cubimongoloid in forum C++ Programming
    Replies: 7
    Last Post: 05-24-2009, 06:22 AM
  2. input question
    By piyush_v in forum C Programming
    Replies: 9
    Last Post: 04-12-2007, 07:09 AM
  3. I'm missing something obvious
    By crash88 in forum C Programming
    Replies: 7
    Last Post: 07-02-2006, 12:51 AM
  4. Program Crashing
    By Pressure in forum C Programming
    Replies: 3
    Last Post: 04-18-2005, 10:28 PM
  5. count only lines of code...
    By flightsimdude in forum C Programming
    Replies: 13
    Last Post: 09-23-2003, 07:08 PM