top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How many loops operations are there in C Language?

–3 votes
983 views
How many loops operations are there in C Language?
posted Aug 19, 2015 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button
There is no use of increasing number of question in the forum, if it is not helpful for someone , stop posting question which you already know or can get answers from generic time spending.
Agree and seen people hide their identity also in asking simple questions.
I believe that use of forum should if you want to share some new thing by asking question or some doubts you are not able to clear based on books or google search, or you have spent a hell lot of time to get an answer of the question you can ask.
we should not ask such questions which is direct in nature.

Hiding identity is not a problem but asking questions just for sake has no meaning.
Yes you are very true thats why we keep on cleaning the question or keep marking them duplicate. Unfortunately there is no control on the peoples behavior so cant do much other then giving negative votes :(
Suggestions are welcome by which we can improve the quality of questions ...

4 Answers

+1 vote
 
Best answer

three basic types of loops which are:

“for loop”
“while loop”
“do while loop”

while loop
Repeats a statement or group of statements while a given condition is true. It tests the condition before executing the loop body.

for loop
Execute a sequence of statements multiple times and abbreviates the code that manages the loop variable.

do...while loop
Like a while statement, except that it tests the condition at the end of the loop body

nested loops
You can use one or more loop inside any another while, for or do..while loop.

answer Aug 21, 2015 by Sindhu Bharathi N N
+1 vote

There are three types of loops in C:
for,
while, and
do..while.

Each of them has their specific uses, which are as follows -

for ( variable initialization; condition; variable update ) {
  Code to execute while the condition is true
}

while (condition) {
  Code to execute while the condition is true
}

do {
} while ( condition );

For and while loop are same except the the ease of use, where as do..while loop is executed atleast once even is condition is failed from the start.

answer Mar 10, 2016 by Ashish Kumar Khanna
0 votes

It looks like a very simple question and one of the basic concepts of C programming language. Almost every programming language has the concept of loop.
Following construct of loop what I know
- while
- do- while
- for
- goto and label.

Please add If I missed .

answer Aug 19, 2015 by Vikram Singh
0 votes

Basic Three Types Of Loops Which Are:

1: while loop
while(expression)
{
statement1
statement2
statement3
...................
}
2:do-while loop
do
{
statement1
statement2
statement3
...................
}while(expression);
3:for loop
for(expression1;expression2;expression3)
{
statement1
statement2
statement3
...................

}

IF WE TALK ABOUT NESTING LOOPS.........

when a loop written inside another loop,it's call nesting of loops.
Ex.
for(i=0;i<ROW;i++)
{
for(j=0;j<COL;j++)
{
printf("(%d,%d)\t",i,j);
}
printf("\n");
}

NOTE: not necessary that inside loop are same.a

answer Mar 13, 2016 by Ajay Kumar
...