Loops in C language by R4R Team

-Any code that are written inside the loop are run continously until the loop condition is become.

Structure of loop in C:

Basically, any loop are contain 3 basic things:
1.initialization
2.condition
3.increament/decreament

Types of Loop in C:
1. for loop
2. while loop
3. do while loop

1. for loop:

Syntax-
for(initialization,condition,++/--)
{
body;
}

2. while loop:

Syntax-
initialization;
while(condition)
{
body;
++/--;
}

3. do while loop:

Syntax-
initialization;
do{
++/--;
}while(condition)

-Where(++/--) shows the increament/decreament of the variable value.

Entry control loop:

-Loop where condition is check before running the loop is called as Entry control loop.
Example-
for loop
while loop

Exit control loop:

-Loop in which condition is check after running the loop is called as Exit control loop.
Example-
do while loop




Leave a Comment:
Search
Categories
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!