63 217
Assignments Done
99,3%
Successfully Done
In July 2018

Answer to Question #13686 in C# for kimie

Question #13686
Write a program that will ask the user to enter 100 numbers and display on the screen the highest and lowest of these numbers.
Expert's answer
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
class Program
{
& static void Main(string[] args)
& {

int[] array = new int[100];

for (int i = 0; i < 100; i++)
{
array[i] = int.Parse(Console.ReadLine());
}
int max = array[0], min = array[0];
for (int i = 1; i < 100; i++)
{
if (array[i] > max) max = array[i];
if (array[i] < min) min = array[i];
}
Console.WriteLine("Max: " + max + "\nMin: " + min);
& }
}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions