Java Basic Activities : Do While Loop




=====================
Code:
=====================

import java.util.Scanner;

public class Test36_Pereda_dowhileloop {

public static void main(String [] args) {

Scanner input = new Scanner(System.in);


int i =1, nums;

do {

i++;
System.out.print("Enter a number: ");
nums = input.nextInt();

System.out.println("The number you entered: " +nums);




}while(i <=5);


input.close();
}



}






























Walang komento:

Mag-post ng isang Komento