Do-While loop:-
JavaScript Program मे कई ऐसे Statement या Block of Statements होते है जिसे आप Multiple Times Execute कराना चाहते है तो इस Situation मे आप do while Loop का उपयोग कर सकते है। Do while Loop एक Block of Code को बार बार तब तक Execute करता रहता है जब तक की Do while Loop मे दी गई Condition True रहती है Condition के False होते ही Loop को Terminate कर दिया जाता है। यह लूप हमेशा कम से कम एक बार executed होता है इसलिए इसे Exit Controlled Loop भी कहा जाता है
Syntax:-
do{
code to be executed
}while (condition);
Question:- 1. Wap to print the even number between 1 to 100.
2. Wap to print the hellow world for 4 times.
3. Wap to find factorial of a given numbers
Do-While loop:-
There are many such statements or blocks of statements in JavaScript program which you want to execute multiple times, then in this situation you can use do while loop. Do while loop keeps executing a block of code repeatedly until the condition given in the do while loop remains true. As soon as the condition becomes false, the loop is terminated. This loop is always executed at least once, hence it is also called Exit Controlled Loop.
Syntax:-
do{
code to be executed
}while (condition);
Question:- 1. Wap to print the even number between 1 to 100.
2. Wap to print the hellow world for 4 times.
3. Wap to find factorial of a given numbers