Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Threading;
- class CompareNums
- {
- static void Main()
- {
- //Write a program that gets two numbers from the console and prints the greater of them. Try to implement this without if statements.
- Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture;
- Console.Write("Enter number One: ");
- double a = double.Parse(Console.ReadLine());
- Console.Write("Enter number Two: ");
- double b = double.Parse(Console.ReadLine());
- Console.WriteLine("The greater number of the two is: " + Math.Max(a, b));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment