Advertisement
Qrist

Smallest of Three Numbers

Apr 14th, 2020
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.58 KB | None | 0 0
  1. using System;
  2. class Program
  3. {
  4.     static void Main(string[] args)
  5.     {
  6.         int first = int.Parse(Console.ReadLine());
  7.         int second = int.Parse(Console.ReadLine());
  8.         int third = int.Parse(Console.ReadLine());
  9.         Smallest(first, second, third);
  10.     }
  11.     public static void Smallest(int a,int b,int c)
  12.     {
  13.         if(a<b && a<c)
  14.         {
  15.             Console.WriteLine(a);
  16.         }
  17.         else if(b<a&&b<c)
  18.         {
  19.             Console.WriteLine(b);
  20.         }
  21.         else
  22.         {
  23.             Console.WriteLine(c);
  24.         }
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement