// 2- Write a program which takes two numbers from the console and displays the maximum of the two.
Console.WriteLine("Type a number");
var input0 = Console.ReadLine();
int.TryParse(input0, out int value0);
Console.WriteLine("Type a second number");
var input1 = Console.ReadLine();
int.TryParse(input1, out int value1);
if (value0 > value1)
{
Console.WriteLine("The bigger value is: " + value0);
}
else
{
Console.WriteLine("The bigger value is: " + value1);
}
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.