skipter icon

C# 3 int / Method for 2 -> Smaller of 3

skipter | PRO | 06/16/17 09:36:07 PM UTC | 0 ⭐ | 293 👁️ | Never ⏰ | []
C# |

680 B

|

None

|

0 👍

/

0 👎

using System;
namespace Arrays_Exercise
{
    class Program
    {
        static void Main(string[] args)
        {
            int a = int.Parse(Console.ReadLine());
            int b = int.Parse(Console.ReadLine());
            int c = int.Parse(Console.ReadLine());            
            int minNumber = GetMin(a, b);
            int smallerFinal = GetMin(minNumber, c);
            Console.WriteLine(smallerFinal);            
        }
        private static int GetMin(int a, int b)
        {
            if (a < b)
            {
                return a;
            } else
            {
                return b;
            }            
        }        
    }
}

Comments