Skip to content

Instantly share code, notes, and snippets.

@IvanNikolov
Created October 15, 2014 09:30
Show Gist options
  • Save IvanNikolov/c71b7b3f26d015b0491d to your computer and use it in GitHub Desktop.
Save IvanNikolov/c71b7b3f26d015b0491d to your computer and use it in GitHub Desktop.
using System;
//Write a program that finds the biggest of three numbers.
//Examples:
//a b c biggest
//5 2 2 5
//-2 -2 1 1
//-2 4 3 4
class BigestOf3Numbers
{
static void Main()
{
double a = double.Parse(Console.ReadLine());
double b = double.Parse(Console.ReadLine());
double c = double.Parse(Console.ReadLine());
if (a>b || a>c)
{
Console.WriteLine(a);
}
else if (b>a && b>c)
{
Console.WriteLine(b);
}
else
{
Console.WriteLine(c);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment