Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class FormattingNumbers
- {
- static void Main()
- {
- {
- System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture;
- while (true)
- {
- Console.WriteLine("Please Insert three numbers: ");
- string firstNumber = Console.ReadLine();
- int a = int.Parse(firstNumber);
- if (a < 0 || a > 500)
- {
- Console.WriteLine("Invalid Input!");
- }
- }
- int numberA1 = a;
- float b = float.Parse(Console.ReadLine());
- float c = float.Parse(Console.ReadLine());
- string binaryB = Convert.ToString(a, 2);
- int binary = int.Parse(binaryB);
- Console.WriteLine("|{0,-10:X}|{1:0000000000}|{2,10:.##}|{3,-10:f3}|", a, binary, b, c);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement