Skip to content

Instantly share code, notes, and snippets.

@MladenMladenov
Created July 25, 2015 07:10
Show Gist options
  • Save MladenMladenov/b386606513d08ba05a29 to your computer and use it in GitHub Desktop.
Save MladenMladenov/b386606513d08ba05a29 to your computer and use it in GitHub Desktop.
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