Answer Posted / dharmendra nonia
using System;
class Factorial
{
public static void accept()
{
double a;
Console.WriteLine("Enter ur Number:");
a=Double.Parse(Console.ReadLine());
double res=fac(a);
Console.WriteLine(res);
}
public static double fac(double d)
{
if (d == 1)
return 1;
else
return d * fac(d - 1);
}
public static void Main()
{
accept();
Console.Read();
}
}
| Is This Answer Correct ? | 8 Yes | 0 No |
Post New Answer View All Answers
What are the different states of a thread?
What is the use of oops in c#?
What is the base class in .net from which all the classes are derived from?
Is java better than c#?
Explain About Web.config
What are primitive data types in c#?
Explain the difference between the debug class and trace class?
What is the purpose of escape sequence?
What is datagrid c#?
Can namespace contain the private class?
Why delegates are required?
How do I get deterministic finalization in c#?
Is char * null terminated?
What is action c#?
What is default method in c#?