Advertisement
mmayoub

Ex01, 21.06.2021, other

Jun 26th, 2021
915
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.85 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Ex21062021
  4. {
  5.     class Program2
  6.     {
  7.         static void Main1(string[] args)
  8.         {
  9.             int a, b, c;    // Three numbers for input
  10.            
  11.            
  12.             // get first number
  13.             Console.Write("Enter a number: ");
  14.             a = int.Parse(Console.ReadLine());
  15.  
  16.             // get second number
  17.             Console.Write("Enter second number: ");
  18.             b = int.Parse(Console.ReadLine());
  19.  
  20.             // get third number
  21.             Console.Write("Enter Third number: ");
  22.             c = int.Parse(Console.ReadLine());
  23.  
  24.             int min, mid, max;
  25.  
  26.             min = Math.Min(Math.Min(a, b), c);
  27.             max = Math.Max(Math.Max(a, b), c);
  28.             mid = a + b + c - min - max;
  29.  
  30.             Console.WriteLine( "{0} , {1} , {2}", min, mid, max);
  31.         }
  32.     }
  33. }
  34.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement