Showing posts with label how to suspend execution for some time in c program. Show all posts
Showing posts with label how to suspend execution for some time in c program. Show all posts

Tuesday, 3 February 2015

Sleep function in C++

Structure of the Problem Requirements 

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++