Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- class BiggerNumber
- {
- static void Main()
- {
- Console.WriteLine("Enter two numbers, separated by a space.");
- int[] input = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
- int firstNum = input[0];
- int secondNUm = input[1];
- int max = GetMax(firstNum, secondNUm);
- Console.WriteLine("The bigger number is: {0}", max);
- Console.WriteLine("If the numbers are equal, the program prints the left one.");
- }
- static int GetMax (int a, int b)
- {
- if (a >= b)
- {
- return a;
- }
- else
- {
- return b;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement