import java.util.Scanner;
public class KeepEnteringNumbersTillUserEntersMultipleOf {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
do {
System.out.println("Enter your Number : ");
int num = sc.nextInt();
if (num % 10 == 0) {
break;
}
System.out.println(num);
} while (true);
}
}
import java.util.Scanner;
public class KeepEnteringNumbersTillUserEntersMultipleOf {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
do {
System.out.println("Enter your Number : ");
int num = sc.nextInt();
if (num % 10 == 0) {
break;
}
System.out.println(num);
} while (true);
}
}
No comments:
Post a Comment