Java Basic Activities: While Loop



================

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


import java.util.Scanner;

public class Test35_Pereda_whileloop {

public static void main(String [] args) {

Scanner input = new Scanner(System.in);


int i =1, nums;

while(i <=5) {

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

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




}

input.close();
}

}


Walang komento:

Mag-post ng isang Komento