0% found this document useful (0 votes)
3 views1 page

Java Loop Examples: For, While, Do-While

The document provides examples of three types of loops in Java: for loop, while loop, and do-while loop. Each loop counts from 1 to 10 and prints the numbers. The examples illustrate the syntax and structure of each loop type.

Uploaded by

munashe1607
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)
3 views1 page

Java Loop Examples: For, While, Do-While

The document provides examples of three types of loops in Java: for loop, while loop, and do-while loop. Each loop counts from 1 to 10 and prints the numbers. The examples illustrate the syntax and structure of each loop type.

Uploaded by

munashe1607
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

JAVA LOOPS EXAMPLE

// Loops counting from 1-10

Example //for loop //while loop //do-while


for(inti=1;i<=10;i++){ inti=1; int i;
[Link](i); while(i<=10){ do{
} [Link](i); [Link](i);
i++; i++;
} }while(i<=10);

You might also like