JAVA PART - #5 FOR LOOP, WHILE LOOP, DO-WHILE LOOP.
Youtube channel :- madhavgediya
Java playlist :- java playlist link
This video like :- video
LOOPING STATEMENT
Main Three Type of Loop :-
1) for loop
2) while loop
3) do_while loop
-: FOR LOOP :-
- A for loop is useful when you know how many times a task is to be repeated.
- For loop Syntax :-
For (initialization; condition; increment/decrement)
{
//Statements
}
-: WHILE LOOP :-
- A while loop is a control structure that allows you to repeat a task a certain number of times.
- while loop is one type entry control loop.
- While Loop Syntax :-
Variable declaration
while(condition)
{
//Statements
// increment / decrement
}
-: DO WHILE LOOP :-
- A do...while loop is similar to a while loop.
- Do…while loop is exit control loop.
- Do While Syntax :-
do
{
//Statements
// Increment / Decrement
}
while(condition);
Comments
Post a Comment