0% found this document useful (0 votes)
34 views6 pages

Compapppptbyharshitkochar

Uploaded by

krushna vaidya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views6 pages

Compapppptbyharshitkochar

Uploaded by

krushna vaidya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Made by :-

Harshit kochar
Introduction
 The iteration system allows a set of instructions to be
performed repeatedly until a certain condition is
fulfilled . The iteration statements are also called
loops or looping statements .Java provides three kinds
of loops :
 For loop
 While loop
 Do-while loop
For loop
 The for loop is the easiest to understand of the java
loops . All its elements are gathered in one place
.Syntax of for loop :
for(initialization expression(s);test-expression;
update expression(s) )
Body-of-the-loop;
While loop
 The second loop available in java is while loop .
The syntax of a while loop is:
while(expression)
loop –body
where loop body may contain a single statement , a
compound statement or an empty statement .
Do –while loop
 Unlike for and while loops ,the do-while evaluates its
test-expression at the bottom of the loop after excuting
its loop-body statements .
Syntax of a do-while loop is :
do{
statement ;
}
while(test-expression) ;
Thank you

You might also like