//Program to display numbers from 1 to 10 using do while loop
package javaPrograms;
public class DoWhileLoop {
public static void main(String args[])
{
int num=1;
do
{
System.out.println(num);
num++;
}
while(num<=10);
}
}
package javaPrograms;
public class DoWhileLoop {
public static void main(String args[])
{
int num=1;
do
{
System.out.println(num);
num++;
}
while(num<=10);
}
}
O/P:
1
2
3
4
5
6
7
8
9
10