Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class FormattingNum
- {
- static void Main()
- {
- Console.WriteLine("Enter number A: ");
- int a = int.Parse(Console.ReadLine());
- Console.WriteLine("Enter number B: ");
- float b = float.Parse(Console.ReadLine());
- Console.WriteLine("Enter number C: ");
- float c = float.Parse(Console.ReadLine());
- if (a < 0 || a > 500)
- {
- Console.WriteLine("Invalid number \"A\"!");
- }
- else
- {
- Console.WriteLine("|{0,-10:X}|{1}|{2,10:F2}|{3,-10:F3}|", a, Convert.ToString(a, 2).PadLeft(10, '0'), b, c);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement