Created
July 25, 2015 07:10
-
-
Save MladenMladenov/b386606513d08ba05a29 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
class FormattingNumbers | |
{ | |
static void Main() | |
{ | |
Console.WriteLine("Please enter one three numbers:"); | |
int a = int.Parse(Console.ReadLine()); | |
double b = double.Parse(Console.ReadLine()); | |
double c = double.Parse(Console.ReadLine()); | |
Console.WriteLine("|{0}|{1}|{2,10:0.##}|{3,-10:0.###}|", (a.ToString("X").PadRight(10,' ')),(Convert.ToString(a,2).PadLeft(10,'0')),b,c); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment