Basic C# code for Pythagoras task.

Amatya
Posted by Amatya under C# category on | Points: 40 | Views : 391
Basic C# code for Pythagoras task.


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

namespace DNFPractice
{
class Program
{
public static void Main(string[] args)
{

double FirstNum, SecondNum, Hypo;
Console.WriteLine("Enter the First Side ");
FirstNum = double.Parse(Console.ReadLine());
Console.WriteLine("Enter the Second Side ");
SecondNum = double.Parse(Console.ReadLine());
Hypo = Math.Sqrt(FirstNum * FirstNum + SecondNum * SecondNum);
Console.WriteLine("The Other Side is : {0}", Hypo);
Console.ReadLine();

}
}
}


Thanks
Amatya

Comments or Responses

Login to post response