Advertisement
Guest User

app

a guest
May 22nd, 2015
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.43 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class test2 {
  4.         public static void main(String[] args) {
  5.             Scanner in = new Scanner(System.in);
  6.  
  7.             int num1;
  8.  
  9.             System.out.println("Enter a positive integer:");
  10.             num1 = in.nextInt();
  11.  
  12.             while (num1 = 0 ){
  13.  
  14.             if (num1 % 2 = 0 ){
  15.  
  16.             System.out.print();
  17.             num1 = num1 / 2;
  18.  
  19.  
  20.             }
  21.  
  22.             else if (num1 % 2 = 1){
  23.  
  24.                 System.out.print();
  25.                 num1 = num1 / 2;
  26.             }
  27.  
  28.         }
  29.  
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement