fork(2) download
  1. import java.util.Scanner;
  2.  
  3. class Program {
  4. public static void main(String[] args) {
  5. Scanner sc = new Scanner(System.in);
  6. int mask = 0b100000;
  7. int n = sc.nextInt();
  8. System.out.println(Integer.toString(n, 2));
  9. if ((n & mask) != 0) {
  10. System.out.println("6th bit is true!");
  11. } else {
  12. System.out.println("6th bit is false");
  13. }
  14. sc.close();
  15. }
  16. }
Success #stdin #stdout 0.12s 42948KB
stdin
63
stdout
111111
6th bit is true!