Write a program to display the highest of any 10 numbers entered.
Sample Output
Sample Solution
C# Sharp Codeusing System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApplication3 { class Program { static void Main(string[] args) { int I, n1, max = 0; Console.WriteLine("Enter any Number 10 times "); for (I = 0; I <= 9; I++) { n1 = Convert.ToInt32(Console.ReadLine()); if (n1 > max) { max = n1; } } Console.WriteLine("The largest number is:" + max); Console.ReadLine(); } } }
Sample Output
No comments:
Post a Comment