programming-examples/c-sharp/Mathematics/C# Program to Find the Cube Root of a Given Number.cs

20 lines
416 B
C#
Raw Normal View History

2019-11-15 12:59:38 +01:00
/*
* C# Program to Find the Cube Root of a Given Number
*/
using System;
class CubeRoot
{
public static void Main()
{
double num, res;
Console.Write("Enter the Number : ");
num = double.Parse(Console.ReadLine());
res = Math.Ceiling(Math.Pow(num, (double)1 / 3));
Console.Write("Cube Root : " + res);
}
}
/*
Enter the Number : 8
Cube Root : 2