Friday 1 December 2017

C# Program to Find a Number using Pythagoras Theorem


Code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
class Program
{
    static void Main(string[] args)
    {
        double a, b, c;
        Console.WriteLine("Enter the First Value ");
        a = double.Parse(Console.ReadLine());
        Console.WriteLine("Enter the Second Value ");
        b = double.Parse(Console.ReadLine());
        c = Math.Sqrt(a * a + b * b);
        Console.WriteLine("The Other Number is : {0}", c);
        Console.ReadLine();

    }
}


Output:

Enter the First Value
3
Enter the Second Value
4
The Other Number is : 5


More C# Programs:


















100+ Best Home Decoration Ideas For Christmas Day 2019 To Make Home Beautiful

Best gifts for Christmas Day | Greeting cards for Christmas Day | Gift your children a new gift on Christmas day This Christmas d...