What is an infinite loop in C Language?

A loop running continuously for an indefinite number of times is called the infinite loop.

Infinite For Loop:

  1. for(;;){
  2. //code to be executed
  3. }

Infinite While Loop:

  1. while(1){
  2. //code to be executed
  3. }

Infinite Do-While Loop:

  1. do{
  2. //code to be executed
  3. }while(1);