for loop it consists of 3 parts 1. initialization 2. condition 3. incrementation like
for(i=1;i<=10;i++).This loop executes 10 times.
While loop: This is an entry check loop. First it checks for the condition and if the condition is true then only loop will be executed and this continues till the condition becomes false.
ex: i=0;
while(i<10)
{i++;
} This loop executes 10 times.
Do loop: This is an exit check loop. This executes the loop at least once even when the condition is false.
ex: 1=0;
do
{
i++;
}while(i<10);
The do while loop is executed at least once, while the for loop may not be executed even once.
the counter variable cannot be initialized in while loop before entering into the block.
Both are programming commands. A do/while loop will execute at least once. A while loop may not execute at all.
Easy: if-else is not a loop; while, for and do-while are loops.if-else just run once, but do-while run many times.
Well 'while' goes like this: while (condition) statement 'for': for (initialize; condition; after-each-loop) statement
No difference.
You mean PL/SQL? Well, they are different things, read the manual for details.
the main difference b/w do and while loops is that do loop will run atleast once even if condition is not satisfied but while loop will not execute even once if condition is not satisfied . this is bcoz in do loop condition is checked after one execution but in while condition is prechecked.
The most important differences are: a. The while loop starts with a condition whereas the condition is the line of code in case of a do while loop b. The do while loop is guaranteed to run the loop body atleast once even if the condition is an impossible to satisfy but such a guarantee is not available with the normal while loop
loop checking is perform before cable termination..the difference between a close loop and open loop is,tha close loop has a feedback while the open loop has not.
While: If we can use while statement it will check the condition then proceed further loop statement.DoWhile: If we use dowhile, first execute loop statement then check the condition.
The difference is that pre means before and post means after in Latin so it's tested before or after. :)
A while loop executes code inside the while block continuously until the said condition is not true. A for loop contains three parts. The first part is carried out prior to the for loop, the middle part is executed by the for loop until it is no longer true, and the final part is performed at the end of each go round of the loop.