Computer Science, asked by anjuphemrom76, 9 months ago

Syntax of delay loop

Answers

Answered by Pra1ham09
2

Answer:Delay in C: delay function is used to suspend execution of a program for a particular time.

Declaration: void delay(unsigned int);

Here unsigned int is the number of milliseconds (remember 1 second = 1000 milliseconds). To use delay function in your program you should include the "dos.h" header file which is not a part of standard C library.

If you don't wish to use delay function then you can use loops to produce delay in a C program.

#include<stdio.h>

int main()

{

  int c, d;

   

  for (c = 1; c <= 32767; c++)

      for (d = 1; d <= 32767; d++)

      {}

       

  return 0;

}

We have not written any statement in the loop body. You may write some statements that doesn't affect logic of the program.

Similar questions