Answer to Question #36740 in C# for Payal Panjwani

Question #36740
Write a C# program that prompts the user to input three integer values and find the greatest value of the three values.
1
Expert's answer
2013-11-29T08:07:43-0500
using System;
using System.Linq;

class Avg
{
public static void Main()
{
int[] values = new int[3];
Console.WriteLine("Enter three integer values (each on separate line):");

for (int qp = 0; qp < values.Length; qp++)
values[qp] = int.Parse(Console.ReadLine());

Console.WriteLine("The greatest value is {0}", values.Max(value => value));
}
}

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 the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS