Advertisement
Saleh_Zoabi

while ex 3

Nov 13th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. package Daay4WhileEx;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Ex4 {
  6.  
  7. public static void main(String[] args) {
  8. // TODO Auto-generated method stub
  9.  
  10. Scanner s = new Scanner(System.in);
  11. int Num, CountDigits = 0;
  12. float Temp,X1,X2;
  13. System.out.println("ENTER A NEW NUMBER");
  14. Num = s.nextInt();
  15.  
  16.  
  17.  
  18. X1 = Num%10;
  19. Temp = Num/10;
  20. X2 = Num%10;
  21.  
  22. while ((Num % 7 != 0)&&(Num%111 != 0)){
  23.  
  24. System.out.println("ENTER A NEW NUMBER");
  25. Num = s.nextInt();
  26.  
  27. }
  28.  
  29. System.out.printf("%d THIS IS a GOOD NUMBER\n", Num);
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40. }
  41.  
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement