Advertisement
bacco

Max Method

May 24th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.66 KB | None | 0 0
  1. using System;
  2.  
  3. namespace MaxMethod
  4. {
  5.     class MainClass
  6.     {
  7.         public static void Main(string[] args)
  8.         {
  9.             int firstNum  = int.Parse(Console.ReadLine());
  10.             int secondNum = int.Parse(Console.ReadLine());
  11.             int thirdNum  = int.Parse(Console.ReadLine());
  12.  
  13.             int result = GetMaxNumber(firstNum, GetMaxNumber(secondNum, thirdNum));
  14.  
  15.             Console.WriteLine(result);
  16.  
  17.         }
  18.         static int GetMaxNumber(int firstNum, int secondNum)
  19.         {
  20.             if (firstNum > secondNum)
  21.             {
  22.                 return firstNum;
  23.             }
  24.             return secondNum;
  25.         }
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement