Advertisement
hpilo

Chapter4_Loops_Ex8

Dec 15th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.76 KB | None | 0 0
  1. /*
  2.     =====================================================
  3.                    chapter 4: Loops
  4.  
  5.       Ex8: Einstain fractions
  6.     =====================================================
  7. */
  8. public class MyProgram {
  9.     public static void main(String[] args) {
  10.  
  11.         int mone=11,mechane;
  12.         float tester;
  13.         int count=1;
  14.  
  15.         while(mone<100){
  16.             int i=2;
  17.             mechane=mone*i;
  18.             while(mechane<100){
  19.                 tester=mechane/mone;
  20.                 if( mechane%10!=0 ){
  21.                     System.out.println(count + ". " + mone + "/" + mechane);
  22.                     count++;
  23.                 }
  24.                 i++;
  25.                 mechane=mone*i;
  26.             }
  27.             mone++;
  28.         }
  29.  
  30.  
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement