Find
maximum number input in array
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication27
{
class Program
{
static void Main(string[] args)
{
int i, n, l;
int[] a = new int[10];
Console.WriteLine("enter the
limit:");
n=Convert.ToInt32(Console.ReadLine());
Console.WriteLine("enter the
number:");
for (i = 0; i < n; i++)
{
a[i] = Convert.ToInt32(Console.ReadLine());
}
l = a[0];
for (i = 0; i < n; i++)
{
if (l < a[i])
{
l = a[i];
}
}
Console.Write("maximum
is:");
Console.Write(l);
Console.ReadLine();
}
}
}
https://www.youtube.com/channel/UCKLRUr6U5OFeu7FLOpQ-FSw/videos
0 comments
Post a Comment