Saleh_Zoabi

do while ex 2

Nov 13th, 2017
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. package Daay4WhileEx;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class ex2dowhile {
  6.  
  7. public static void main(String[] args) {
  8. // TODO Auto-generated method stub
  9.  
  10.  
  11.  
  12.  
  13. int Num;
  14. Scanner s = new Scanner(System.in);
  15.  
  16.  
  17. do {
  18. System.out.println("enter a new number");
  19. Num = s.nextInt();
  20.  
  21.  
  22.  
  23. }
  24.  
  25. while ((Num%111 != 0)&&(Num % 7 != 0));
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33. }
  34.  
  35. }
Advertisement
Add Comment
Please, Sign In to add comment