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 lazy keyword in c#?
What is poco c#?
can you allow a class to be inherited, but prevent the method from being over-ridden?
What is an arraylist in c#?
What is verbatim literal in c#?
What is static and use of it?
Can you create sealed abstract class in c#?
What is view state c#?
How does a while loop work?
What is the use of thread join in c#?
Is post back c#?
Is c# dictionary a hash table?
What is tpl in c#?
Can you use all access modifiers for all types?
What are jump statements in c#?