You are on page 1of 1

using using using using

System; System.Collections.Generic; System.Linq; System.Text;

namespace ConsoleApplication1 { class Program { static void Main(string[] args) { int a=0,b=0,mayor=0; Console.WriteLine("SABER EL MAYOR VALOR DE UNA LISTA DE NUNEROS"); Console.WriteLine("CUANDO QUIERAS SALIR PULSA 0 "); Console.WriteLine("ingresar valores "); do { a = Convert.ToInt32(Console.ReadLine()); b = Convert.ToInt32(Console.ReadLine()); if (a > b && a > mayor ) { mayor = a; } else if (a<b && b >mayor ) { mayor = b; } } while (a != 0 && b != 0); Console .WriteLine ("el numero mayor es:{0}",mayor ); Console.ReadKey(); } } }

You might also like