Home for the Programmer, Webmaster and Bloggers

13 December 2018

HOW TO CALCULATE MEAN IN C#


Image result for c# image
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Even
{
    class Program
    {
        static void Main(string[] args)
        {
                    int counter;
                                double marks;
                   double scores = 0;
           
              Console.WriteLine("Enter Number Of Student");

             counter = int.Parse (COnsole.ReadLine());

                    for (int i =1; i<=counter; i++)

                            {

                               Console.WriteLine("Enter Students Score");

                                  marks = int.Parse (COnsole.ReadLine());

                                 scores+=marks;

                                }

                                      double mean = scores/counter;

                             Console.WriteLine("Mean="+mean);

                         Console.ReadKey();


        }

    }

No comments:

Post a Comment