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 benefit do you get from using a primary interop assembly (pia)?
What are the uses of delegates in c#?
What is wcf c#?
What is the default value of decimal in c#?
Is array reference type in c#?
Difference between value and reference type. What are value types and reference types?
How does substring work in c#?
Can we call server-side code (c# or vb.net code) from javascript?
Can you create partial delegates and enumerations?
What is the difference between string and stringbuilder in c#?
Why do we need constructor?
What is the class in c#?
What is the root element of an xml file?
Are tuples immutable c#?
What you mean by delegate in c#?