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
Why dataset is used in c#?
What's the difference between abstraction and encapsulation?
What is serialization in .net?
Is null == null c#?
How can I check the type of an object at runtime?
What is difference between variable and property in c#?
What is the difference between internal and protected in c#?
How the versioning applies to Assemblies or can you explain version numbers?
What do multicast delegates mean?
Is a dll an assembly?
Is datetime a value type in c#?
In a site to turn off cookies for one page which method is followed?
What are extension methods and where can we use them?
Differentiate between object pooling and connection pooling in c#?
Explain what is copy constructor?