G
Guest
Hey,
Can some one tell me about what's wrong with the following code and what is
the solution with some meaningful correction
-----------------------------
class Program
{
static void Main(string[] args)
{
int x, y;
Console.WriteLine("Enter 2 numbers");
x= Convert.ToInt32(Console.ReadLine());
y=Convert.ToInt32(Console.ReadLine());
x = MaxNum(x, y);
Console.WriteLine("The big number is {0}",x);
}
private int MaxNum(int l, int m)
{
if (l > m)
return l;
else
return m;
}
}
-----------------------------
Can some one tell me about what's wrong with the following code and what is
the solution with some meaningful correction
-----------------------------
class Program
{
static void Main(string[] args)
{
int x, y;
Console.WriteLine("Enter 2 numbers");
x= Convert.ToInt32(Console.ReadLine());
y=Convert.ToInt32(Console.ReadLine());
x = MaxNum(x, y);
Console.WriteLine("The big number is {0}",x);
}
private int MaxNum(int l, int m)
{
if (l > m)
return l;
else
return m;
}
}
-----------------------------