Reputation: 356
I'm a beginner in programming, and i'm really wondering what's my mistake here :
static void Main(string[] args)
{
int a = int.Parse(Console.ReadLine());
int b = int.Parse(Console.ReadLine());
int c = int.Parse(Console.ReadLine());
if ((a > b) && (a > c))
{
Console.WriteLine(a);
}
else
{
if ((b > a) && (b > c)) ;
{
Console.WriteLine(b);
}
else
{
Console.WriteLine(c);
}
}
}
Upvotes: 2
Views: 1830
Reputation: 98810
You can't use in your if condition ;
. Remove it.
if ((b > a) && (b > c))
{
Console.WriteLine(b);
}
And you need one more }
end of you code.
Edit: Actually you can use ;
with your if condition. For example;
if ((b > a) && (b > c));
is equal
if ((b > a) && (b > c))
{
}
Upvotes: 1