Advertisement
Primitiv0

Highest of 3 Numbers

Sep 10th, 2019
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.90 KB | None | 0 0
  1. using System;
  2.  
  3.  class Program
  4.     {
  5.         static void Main(string[] args)
  6.         {
  7.  
  8.             Console.WriteLine("Ingrese un numero");
  9.             int A = Convert.ToInt16(Console.ReadLine());
  10.             Console.WriteLine("Ingrese un numero");
  11.             int B = Convert.ToInt16(Console.ReadLine());
  12.             Console.WriteLine("Ingrese un numero");
  13.             int C = Convert.ToInt16(Console.ReadLine());
  14.             if (A > B && A > C)
  15.             {
  16.                 Console.WriteLine("El numero mayor es " + A);
  17.             }
  18.             else
  19.             {
  20.                 if (B > A && B > C)
  21.                 {
  22.                     Console.WriteLine("El numero mayor es " + B);
  23.                 }
  24.                 else
  25.                 {
  26.                     Console.WriteLine("El numero mayor es " + C);
  27.                 }
  28.             }
  29.             Console.ReadLine();
  30.         }
  31.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement