68 229
Assignments Done
99%
Successfully Done
In November 2018

Answer to Question #41710 in C# for fahmida

Question #41710
accept ten numbers from the user and display following output
5
4
9
11
16
5
8
10
12
17
3 and also display their sum .. average ,largest number ,and smallest number by using for loop and counter variable
Expert's answer
usingSystem;
usingSystem.Collections.Generic;
usingSystem.Linq;
usingSystem.Text;
usingSystem.Threading.Tasks;
 
namespaceConsoleApplication1
{
class Program
{
  static void Main(string[] args)
  {
int[] numbers = new int[10];
 
Console.WriteLine("Input tennumbers:");
 
for (int i = 0; i < 10; i++)
numbers[i] =int.Parse(Console.ReadLine());
 
  Console.WriteLine("Output:");
 
for (int i = 0; i < 10; i++)
Console.WriteLine("{0}", numbers[i]);
 
Console.WriteLine("Sum:{0}", numbers.Sum());
Console.WriteLine("Average:{0}", numbers.Average());
Console.WriteLine("Min:{0}", numbers.Min());
Console.WriteLine("Max: {0}",numbers.Max());
 
Console.ReadLine();
  }
}
}

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