Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Problem_6_FormatingNumbers {
- public static void main(String[] args) {
- Scanner scan= new Scanner(System.in);
- int a = scan.nextInt();
- float b = scan.nextFloat();
- float c = scan.nextFloat();
- System.out.printf("|%-10X", a);
- System.out.printf(String.format("|%10s", Integer.toBinaryString(a)).replace(" ", "0"));
- System.out.printf("|%10.2f",b);
- System.out.printf("|%-10.3f|",c);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement