Introduction :
Many tasks are needed to be done with the help of computer and they are repetitive in nature.for example,the salary of labor's of a factory is calculated by the formula .
Number of hours x wage rate.
This calculation will be performed by an accounted for each worker every month. such type of repetitive actions can be easily done using a program that has a loop built into the solution of the program.
What is a loop ?
Many tasks are needed to be done with the help of computer and they are repetitive in nature.for example,the salary of labor's of a factory is calculated by the formula .
Number of hours x wage rate.
This calculation will be performed by an accounted for each worker every month. such type of repetitive actions can be easily done using a program that has a loop built into the solution of the program.
What is a loop ?
Ans: a loop is defined as a block of statements which are repeatedly executed for certain number of times.
The c language supports three types of loop control statements.these are...
1) while loop.
2) for loop.
3) do while loop.
Any loop concept can be written in three ways
1) With body :-
This is a default discipline,when ever multiple statements are defined with body will take place.
2) With out body :-
When ever we define with out body at the time of execution with in the body only one statement will takes place.
3) With semi column :-
when ever we define with semi column at the time of execution it replace with entry body.
Any loop concept can be written in three ways
1) With body :-
This is a default discipline,when ever multiple statements are defined with body will take place.
2) With out body :-
When ever we define with out body at the time of execution with in the body only one statement will takes place.
3) With semi column :-
when ever we define with semi column at the time of execution it replace with entry body.