Wednesday, 24 April 2013

Write a program to display the highest of any 10 numbers entered. (Duration: 30 min)


using System;
using System.Collections.Generic;
using System.Text;
namespace largest_loop
{
class program
{
static void Main(string[]args)
{
int ctr, nNum1, max=0;

for (ctr=0; ctr<=9; ctr++)
{
    Console.WriteLine("Enter the numbers"+(chr+1));
nNum1 = Console.ToInt32(Console.ReadLine());
if (nNum1>max)
     max=nNum1;

}
Console.WriteLine(max);
    Console.ReadLine();
}
}
}

No comments:

Post a Comment