Table of Content

How to use Delay Function in c program ?

Program :


    printf("C program will exit in 20 seconds.");        


    return 0;

Output : Output displayed for 20 seconds

This c program will exit in 20 seconds.

Explanation :

void delay(unsigned int);


  • Delay function is used to suspend execution of a program for a particular time.
  • It requires Unsigned Integer as Parameter
  • Unsigned int is number in miliseconds
  • Note 1sec = 1000miliseconds
  • Header File : dos.h