C# Program to Calculate the Area of a Triangle

In this C# program, we will take input (Base and Height) from the user and calculate the area of a Triangle. Formula to calculate area of Triangle is A= (base*height/2).

C# Program to Calculate the Area of a Triangle Code:

private static void Main(string[] args)
        {
            double Base, Height;
            Console.Write("Enter Base of Triangle: ");
            Base = Convert.ToDouble(Console.ReadLine());
            Console.Write("Enter Height of Triangle: ");
            Height = Convert.ToDouble(Console.ReadLine());
            double area = Base * Height/2;
            Console.WriteLine("Area of Triangle is : {0}", area);
            Console.ReadLine();
        }	

C# Program to Calculate the Area of a Triangle Output:

C#-Program-to-Calculate-the-Area-of-a-Triangle

 

 
We are nothing without our users ! You can help us offer even more high quality content. Please share our page !
Best quality Asp .Net Ajax Control Toolkit tutorials.

Give your valuable comments.

Name
Email
Comment
1 + 8 =
 
About Us | Terms of Use | Privacy Policy | Disclaimer | Contact Us Copyright © 2012-2022 CodingFusion
75 Important SQL Server queries you should know