Skip to content

Instantly share code, notes, and snippets.

@goldcoders
Last active December 7, 2021 14:02
Show Gist options
  • Save goldcoders/5144c8778df5fdc62f89434332eb5ebc to your computer and use it in GitHub Desktop.
Save goldcoders/5144c8778df5fdc62f89434332eb5ebc to your computer and use it in GitHub Desktop.
// Q2 Week2
// No. 2
using System;
public class Program
{
public static void Main()
{
// get the first number and 2nd number
// and show result which is greater than the two numbers
Console.WriteLine("Enter the first number");
int firstNumber = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Enter the second number");
int secondNumber = Convert.ToInt32(Console.ReadLine());
if (firstNumber > secondNumber)
{
Console.WriteLine("The greater number is {0}", firstNumber);
}
else
{
Console.WriteLine("The greater number is {0}", secondNumber);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment