Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Globalization;
- namespace _01._1.PrintingToConsoleSecondOpition
- {
- class PrintingToConsoleSecondOpition
- {
- static void Main()
- {
- for (int i = 0; i < 3; i++)
- {
- System.Threading.Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
- Console.Write("Enter an integer: ");
- int a = int.Parse(Console.ReadLine());
- Console.Write("Enter first floating - point number: ");
- double b = double.Parse(Console.ReadLine());
- Console.Write("Enter second floating - point number: ");
- double c = double.Parse(Console.ReadLine());
- string columnA = Convert.ToString(a, 2);
- Console.WriteLine("{0,-10}|{1,10}|{2,10}|{3,-10}", "Integer a", "Int to bin", "Double 1", "Double 2");
- Console.WriteLine("{0,-10:X}|{1}|{2,10:0.00}|{3,-10:0.000}", a, columnA.PadLeft(10, '0'), b, c);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement