Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace MaxMethod
- {
- class MaxMethod
- {
- static void Main()
- {
- int numberOne = int.Parse(Console.ReadLine());
- int numberTwo = int.Parse(Console.ReadLine());
- int numberThree = int.Parse(Console.ReadLine());
- int greaterNumber =GetMax(numberOne, numberTwo);
- int max =GetMaxFromSecond(numberThree, greaterNumber);
- Console.WriteLine(max);
- }
- private static int GetMaxFromSecond(int numberThree, int numberGetMax)
- {
- if (numberThree > numberGetMax)
- {
- return numberThree;
- }
- else
- return numberGetMax;
- }
- static int GetMax(int a, int b)
- {
- if (a > b)
- {
- return a;
- }
- else
- return b;
- }
- }
- }
Add Comment
Please, Sign In to add comment