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

  1. #include<stdio.h>
  2. #include<dos.h>
  3.  
  4. main()
  5. {
  6.    printf("Wait for 5 seconds to exit.\n");
  7.    sleep(5);
  8.    return 0;
  9. }