1class DoWhileLoopExample {
2 public static void main(String args[]){
3 int i=10;
4 do{
5 System.out.println(i);
6 i--;
7 }while(i>1);
8 }
9}
1class DoWhileLoopExample2 {
2 public static void main(String args[]){
3 int arr[]={2,11,45,9};
4 //i starts with 0 as array index starts with 0
5 int i=0;
6 do{
7 System.out.println(arr[i]);
8 i++;
9 }while(i<4);
10 }
11}