- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconTrick.java
More file actions
Latest commit
15 lines (12 loc) · 508 Bytes
/
Copy pathconTrick.java
File metadata and controls
15 lines (12 loc) · 508 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
importjava.util.Scanner;
classconTrick{
publicstaticvoidmain(Stringargs[]){
Scannerinput = newScanner( System.in );
System.out.print("Enter a decimal number : ");
intnum =input.nextInt();
System.out.println("Decimal to binary: \t"+Integer.toBinaryString(num));
System.out.println("Decimal to Hexadecimal: "+Integer.toHexString(num));
System.out.println("Decimal to octal: \t "+Integer.toOctalString(num));
input.close();
}
}