Pages

Using C# console Programe find the area of triangle.


CODE:


using System;
usingSystem.Collections.Generic;
usingSystem.Linq;
usingSystem.Text;

namespaceAreaofTriangle
{
classProgram
    {
staticvoid Main(string[] args)
        {

intb,h ;
double A;
Console.WriteLine("Please Enter Base");
            b = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Please Enter Hight");
            h = Convert.ToInt32(Console.ReadLine());
            A = 0.5*b * h;
Console.WriteLine(" with Base {0} and Hight {1} the area of Triangle is {2}", b, h, A);


        }
    }
}

OUTPUT:




No comments:

Post a Comment