77 946
Assignments Done
Successfully Done
In August 2019

Answer to Question #34172 in C# for Nkosinathi

Question #34172
how do you write a C# console application 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 three_numbers_and_prints_the_average_value
class Program
static void Main(string[] args)

double sum = 0;//variable for sum of three number
for(int i=0;i<3;i++){
Console.Write("Enter number # " + (i + 1).ToString()+": ");
sum += double.Parse(Console.ReadLine());//read number
Console.Write("The average value is: "+(sum/3).ToString());//show


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!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions