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 is an enumerator c#?
Why objects are stored in heap in c#?
Explain how to implement delegates in c#.net
What are async and await?
What is stringbuilder c#?
Why do we need a singleton class?
Explain the ways to deploy an assembly?
What is the meaning of extention?
What is gac? What are the steps to create an assembly and add it to the gac?
What language is c# similar to?
What is the difference between ienumerable and icollection?
What are the types in c#?
Is datetime value type c#?
What is a string c#?
What is a generic c#?