C++ Program to create a loading flash

#include<iostream.h>
#include<conio.h>
#include<dos.h>

void main()
{
clrscr();
int i;

for(i=0;i<=100;i+=20)
{
cout<<“Loading…….”<<i<<“%r”;
sleep(1);
}

getch();
}

2 thoughts on “C++ Program to create a loading flash

  1. varun amla

    in the above mentioned program..do not write…. int i; outside the loop otherwise it display.error of "multiple declaration for i..
    thanxxx…..

    Reply
    1. Nizwer Blaze

      Try this,

      #include
      #include
      #include

      using namespace std;

      void main()
      {
      system("cls");

      for(int i = 0; i <= 100; i += 25)
      {
      cout << "Loading……." << i << "%r";
      Sleep(1000);
      if (i == 100)
      {
      system("cls");
      cout << "Loading Completed!r";
      }
      }
      getch();
      }

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *