Sleep Function in C++

The sleep function is used to suspend the execution of the program for sometime. The value which passed to the sleep function arguments is in milliseconds. This function exist in windows.h library in C++.

Source Code

#include<iostream>
#include<windows.h>
using namespace std;
int main ()
{
 cout<<" \n \n  \t \t \t \t WELCOME TO LEP \n ";
 Sleep(2000);
 cout<<" 1. ";
 Sleep(2000);
 cout<<" C++ \n ";
 cout<<" 2. ";
 Sleep(2000);
 cout<<" Java \n ";
 cout<<" 3. ";
 Sleep(2000);
 cout<<" Linux \n ";
 cout<<" 4. ";
 Sleep(2000);
 cout<<" Android \n ";
 cout<<"\t \t \t \t Thank u ! \n ";
}

Output of the Program

Sleep function in C++

Share on Google Plus

About Asad

Asad Niazi is Software Engineer , Programmer, Web Developer and a young mentor of BloggersTown and PProgramming. Asad Love to writes about Technology, Programming, Blogging and make money online.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment