Created
January 23, 2015 14:25
-
-
Save SmileyVi/5934ac9192e349c7065a to your computer and use it in GitHub Desktop.
TheBiggestOfThree
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; | |
class TheBiggerstOf3 | |
{ | |
static void Main() | |
{ | |
Console.WriteLine("Enter first number: "); | |
double a=double.Parse(Console.ReadLine()); | |
Console.WriteLine("Enter second number: "); | |
double b=double.Parse(Console.ReadLine()); | |
Console.WriteLine("Enter third number: "); | |
double c=double.Parse(Console.ReadLine()); | |
bool greaterA=(a>b)&&(a>c); | |
bool greaterB=(b>a)&&(b>c); | |
bool greaterC=(c>b)&&(c>a); | |
if (greaterA) | |
Console.WriteLine("{0}",a); | |
else | |
{ | |
if (greaterB) | |
{ | |
Console.WriteLine("{0}",b); | |
} | |
else | |
Console.WriteLine("{0}",c); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment