Pages

Wednesday, November 9, 2016

Use of Time function in C program.

Program will demonstrate use of sleep function in C.

#include<stdio.h>
#include<Windows.h>
int main()
{
   int i;
   printf("Use of time function...\n");       
   printf("\nPress any key to install your software...");
   getch();
    
   for(i=0; i<=100; i++)
   {
      system("cls");
      printf("Installing Software ....%d %%", i);
      Sleep(50);
   }
   Sleep(3000);
   printf("\n\nSoftware Successfully Installed...");
   return 0;
}



Output of the program:


Use of time function...

Press any key to install your software...


When you press any key you will get following output on your screen:

Installing Software ....100 %

Software Successfully Installed...





You may also like to learn following programs:

No comments:

Post a Comment