Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApplication3
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.WriteLine("Please enter your first number");
- int num = Convert.ToInt32(Console.ReadLine());
- Console.WriteLine("Please Enter your second number");
- int num2 = Convert.ToInt32(Console.ReadLine());
- Console.WriteLine("Please enter your third number");
- int num3 = Convert.ToInt32(Console.ReadLine());
- Console.WriteLine(GetMax(num, num2,num3));
- }
- static int GetMax(int num, int num2, int num3)
- {
- if (num > num2 && num > num3)
- {
- return num;
- }
- if (num < num2 && num2 > num3)
- {
- return num2;
- }
- else if (num3 > num && num3> num2)
- {
- return num3;
- }
- return Convert.ToInt32("error");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement