Pythagorean theorem in c#

Apurva Singh



On remembering great Pythagoras, I have made a C# program that calculates Hypotenuse on basis of right angle triangle arms 

you can compile it on Online compilers for C#

i would recommend copying code from my GitHub Repo



using System;

namespace Pythagorean_theorem_Solver_In_C_sharp
{
    class Program
    {
        static void Main(string[] args)
        {
            //Pythagorean theorem in C# 
            Console.Title = "Pythagorean theorem By Apurva Singh";
            Console.WriteLine("This Project's Source Code Is Also Available On My Website https://apurvasingh.ml");
            Console.WriteLine("Pythagorean theorem refers to Side A Squared + Side B Squared = Hypotenuse Squared ");
            Console.WriteLine("Note: Please Enter Single Units Only. Decimal Numbers and words Are Currently Isn't Allowed. Thanks ");
            Console.WriteLine("Please Enter Side A");
            string SideAasString = Console.ReadLine();
            int SideA = Int32.Parse(SideAasString);
            Console.WriteLine("Successfully Entered the value of Side A. You Have Entered " + SideA);
            Console.WriteLine("Please Enter Side B");
            string SideBasString = Console.ReadLine();
            int SideB = Int32.Parse(SideBasString);
            Console.WriteLine("Successfully Entered the value of Side B. You Have Entered " + SideB);
            int SideASQ = SideA * SideA;
            int SideBSQ = SideB * SideB;
            Console.WriteLine("Hypotenuse Is");
            int Final = SideASQ + SideBSQ;
            Console.Write(Math.Sqrt(Final));
            Console.WriteLine(" Units");
            Console.WriteLine("Thanks For Using");
            Console.ReadLine();
    }
}

Post a Comment

0Comments
Post a Comment (0)

#buttons=(I Understand) #days=(1)

Our website uses cookies to enhance your experience. Google Translate and other Google services on this are governed by Google's Privacy Policy. Some of the posts might have been fetched from Syndication Networks
Accept !