Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace SmallestOfThreeNumbers
- {
- class Program
- {
- static void Main(string[] args)
- {
- int num1 = int.Parse(Console.ReadLine());
- int num2 = int.Parse(Console.ReadLine());
- int num3 = int.Parse(Console.ReadLine());
- Console.WriteLine(SmallestNum(num1, num2, num3));
- }
- static int SmallestNum(int num1, int num2, int num3)
- {
- int print = 0;
- if (num1 < num2 && num1 < num3)
- {
- print = num1;
- }
- else if (num2 < num3 && num2 < num1)
- {
- print = num2;
- }
- else
- {
- print = num3;
- }
- return print;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement