Created
October 7, 2014 12:53
-
-
Save IvanNikolov/dd33dfd5a9772f431f31 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; | |
//Write a program that gets two numbers from the console and prints the greater of them. Try to implement this without if statements. Examples: | |
//a b greater | |
//5 6 6 | |
//10 5 10 | |
class NumberComparer | |
{ | |
static void Main() | |
{ | |
double a = double.Parse(Console.ReadLine()); | |
double b = double.Parse(Console.ReadLine()); | |
bool greater = (a > b); | |
Console.WriteLine(greater? a : b); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment