Write a program using Do While Loop in Java - Technology369kk

 Do While Loop in Java

Program:  

// # Q1. Write a Program Do-While Loop Example
// Do While loop use execute statement untill certain becomes false


class DoWhileLoop{
    public static void main(String args[]){
        int i = 0;
        do {
            System.out.println(" This is simple learn:- "+i);
            i++;

        }
        while(i < 5);
    }
}



Output: 



PS D:\Learning File\BCA\BCA 3rd Sem\JAVA OOP\allpraque> java DoWhileLoop
 This is simple learn:- 0
 This is simple learn:- 1
 This is simple learn:- 2
 This is simple learn:- 3
 This is simple learn:- 4


Post a Comment

0 Comments