You are here

sleep c

Sleep function delays program execution for a given number of seconds.

Declaration: void sleep(unsigned seconds);

C programming code for sleep

#include<stdio.h>
#include<dos.h>
 
main()
{
   printf("Wait for 5 seconds to exit.\n");
   sleep(5);
   return 0;
}