You are on page 1of 2

using System;

using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace sumatorirec
{
class Program
{
static void Main(string[] args)
{
int X,Y;
Console.WriteLine("Ingrese un numero");
int A = Convert.ToInt16(Console.ReadLine());
Console.WriteLine("Ingrese un numero");
int B = Convert.ToInt16(Console.ReadLine());
Console.WriteLine("Ingrese un numero");
int C = Convert.ToInt16(Console.ReadLine());
Console.WriteLine("Ingrese un numero");
int D = Convert.ToInt16(Console.ReadLine());
if (A > B && A > C && A > D)
{
X = A;
}
else
{
if (B > A && B > C && B > D)
{
X = B;
}
else
{
if (C > A && C > B && C > D)
{
X = C;
}
else
X = D;
}
}
if (A < B && A < C && A < D)
{
Y = A;
}
else
{
if (B < A && B < C && B < D)
{
Y = B;
}
else
{
if (C < A && C < B && C < D)
{
Y = C;
}
else
Y = D;
}
}
Console.WriteLine("el mayor es " + X + " y el menor es " + Y);
Console.ReadLine();
}
}
}

You might also like