If I use Math as a class name return should be System.Math.Sqrt(num); in order to program to give output.
If I am not using Math as a class name return can be Math.Sqrt(num); in order to program to give output.
Please explain
using
System;public
class Math{
public static void Main(){
double sqrt, number; string sNum;Console.Write("Number = ");
sNum = Console.ReadLine();
number = Convert.ToDouble(sNum);
sqrt = SqrtRoot(number);
Console.WriteLine("Square Root of the number = {0}", sqrt);
}
public static double SqrtRoot(double num){
return System.Math.Sqrt(num);}
}
/*
Number = 81
Square Root of the number = 9
Press any key to continue
*/
Posted Mar 24, 2007, 11:00 AM
Maha
Mike GoldPosted Mar 21, 2007, 6:07 PM