We provide IT Services

Register Now Click On

Read More Tutorials Click On

Post Page Advertisement [Top]


how to make three numbers average program in C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace How_to_Make_avg_program
{
    class Program
    {
        static void Main(string[] args)
        {
            float A, B, C, avg;
            Console.Write("Enter the value of A: ");
            A = Convert.ToInt16(Console.ReadLine());
            Console.Write("Enter the value of B: ");
            B = Convert.ToInt16(Console.ReadLine());
            Console.Write("Enter the value of C: ");
            C = Convert.ToInt16(Console.ReadLine());

            avg = (A + B + C) / 3;

            Console.Write("Total avg :" + avg);
            Console.ReadKey();
        }
    }
}

Output:- Avg three number is 





No comments:

Post a Comment

| Designed by Rockprogrammer