66 982
Assignments Done
99,2%
Successfully Done
In November 2018

Answer to Question #7542 in C# for dp

Question #7542
how do you write a C# program that asks for three numbers and prints the average value.
Expert's answer
using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;




namespace tempCs

{

class Program

{

static void Main(string[] args)

{

int avg=0;

for (int i = 0; i < 3; i++)

{

Console.Write("Enter number " + (i+1) + ": ");

avg += int.Parse(Console.ReadLine());

}

avg /= 3;

Console.WriteLine("Average = " + avg);

}

}

}

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

Assignment Expert
07.09.12, 14:24

You're welcome. We are glad to be helpful.
If you really liked our service please press like-button beside answer field. Thank you!

Avie
07.09.12, 12:57

Thank you works perfectly fine.

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions