C Infinite Loop

C Infinite Loop


Profile photo for Sathish Kumar

Sathish Kumar

, RPA Developer at Cognizant

Answered 4 years ago

To stop an infinitely loop, First you must understand what is loop.

A Loop is set of statements that are executed until a certain condition is met.

A loop will have:

1.Initialization : Here you will initialize the loop variable i.e, You will assign an initial value to the loop variable.

2. Update: Here you will update the value of your loop variable every time the loop is executed to a specific value

3.Termination : Here you will specify the condition which must be checked every time the loop is executed.

For example:

for(i=0;i<10;i++)

{

Set of statements goes here.

}

this loop will execute 10 times from

 

Continue Reading

 

 

7