package java_a5;
// @author hi123
import java.io.*;
import java.util.Scanner;//to use scanner
//import java.long.Integer; why??
public class JAVA_A5 {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.println("Enter the integer");
int num = scan.nextInt();
//scannerObjectName.nextInt = gets int from user
System.out.println("Binary is " + Integer.toBinaryString(num));
System.out.println("Numer of 1 bits is " + Integer.bitCount(num));
}
}
//yeahhhh~~~~
// @author hi123
import java.io.*;
import java.util.Scanner;//to use scanner
//import java.long.Integer; why??
public class JAVA_A5 {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.println("Enter the integer");
int num = scan.nextInt();
//scannerObjectName.nextInt = gets int from user
System.out.println("Binary is " + Integer.toBinaryString(num));
System.out.println("Numer of 1 bits is " + Integer.bitCount(num));
}
}
//yeahhhh~~~~
댓글
댓글 쓰기