Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- public class Mayor
- {
- public static void Main(string[] args)
- {
- int mayor = 1;
- int num = 0;
- int op = 0;
- int cont = 1;
- Console.WriteLine("Este programa imprime el mayor de los numeros ingresados \n");
- do{
- Console.WriteLine("Teclea el {0} numero: ",cont);
- num = Convert.ToInt32(Console.ReadLine());
- if(num>mayor)
- {
- mayor = num;
- }
- Console.WriteLine("Quieres seguir ingresando numeros? ");
- Console.WriteLine("1.- Si 2.- No ");
- op = Convert.ToInt32(Console.ReadLine());
- cont++;
- }while (op == 1);
- Console.WriteLine("El numero mayor fue {0}",mayor);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement