+ 6
How many types of loop we have?
Three types of loop for loop do loop while loop
14 Respostas
0
4 types of loops
1.for
2.while
3.do while
4.enhanced for loop
+ 18
No. Do..while loop
+ 4
Three types
+ 4
10 times forgetting the error of initializing i and instead increment j
+ 3
Do while are those which are tested in bottom
+ 2
for (i=0;i <=10;i++)
how many time loop will excute
+ 2
10 times
+ 2
a)three types of loops exist in C ;
1) for loop
2) while loop
3) do while loop
b) Their syntax are;
int j;// let declare the looping variable
// for loop
for(j=0;j<5;j++) {
// the looping instructions
instructions 1;
.
.
instructions n;
}
//while loop
j=0;
/* with while loop, always initialise before starting the looping*/
while(j<5) {
block of instructions
j++;/*don't forget to specify how the looping variable should displace itself, which is either incremental or decremental
}
//do while loop
do {
j=0;
block of instructions
j++;
}
c) which loop should I used as there are three types of loops? what is the difference between while and do while? if you need to know the answer to these questions on part c, tap reply and I will continue.
+ 2
in mr. mohamed's answer after last curly bracket in do while loop
there should be written as while(condition statement);
like while(j<7);
+ 2
for (i=1;i <=10;j++)
how many type loop will excute
+ 1
11times the will be excuted @puneet
+ 1
for loop
while loop
do while loop
+ 1
loop will execute for 11 times @puneet,since loop starts from 0 and goes till 10
means 11
if the loop structure had been
for(i=0;i<10;i++)
the. it would have executed 10 times as the loop fails when i=10
+ 1
ooh I thought that I put it already
this is the syntax
// do while loop
do {
instructions;
initialize or increment j;
} while(j<7);. // the semi colon at the end is very important