pupesko

SoftUni - 4.4 Number Comparer

Sep 30th, 2015
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.62 KB | None | 0 0
  1. using System;
  2. using System.Threading;
  3.  
  4. class CompareNums
  5. {
  6.     static void Main()
  7.     {
  8.     //Write a program that gets two numbers from the console and prints the greater of them. Try to implement this without if statements.
  9.  
  10.         Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture;
  11.  
  12.         Console.Write("Enter number One: ");
  13.         double a = double.Parse(Console.ReadLine());
  14.  
  15.         Console.Write("Enter number Two: ");
  16.         double b = double.Parse(Console.ReadLine());
  17.  
  18.         Console.WriteLine("The greater number of the two is: " + Math.Max(a, b));
  19.  
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment