Skip to content

Instantly share code, notes, and snippets.

@SmileyVi
Created January 23, 2015 14:25
Show Gist options
  • Save SmileyVi/5934ac9192e349c7065a to your computer and use it in GitHub Desktop.
Save SmileyVi/5934ac9192e349c7065a to your computer and use it in GitHub Desktop.
TheBiggestOfThree
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