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 CASPOL?
How do I unload an application domain?
What is native image generator (ngen.exe)?
Can we make a class private in c#?
What is the relationship between a process, application domain, and application?
Can datetime be null c#?
Hi Friends, I am going through Siemens Interview Procedure from last 1+1/2 months. I went through 1 written + 2 Technical + 1 Managerial Round process after which I got call from HR informing that "you are selected and we would like to meet you for HR round". HR round was very nominal compared to MR. HR Round last for hardly 5 mins. They told me that you will get the final result on Friday. Still I have not received any feedback from them. Please help!!!
Is vs as c#?
List the differences between method overriding and method overloading?
What is the process of delegation?
What does protected internal access modifier mean?
Can you inherit from a sealed class?
What is the benefit of interface in c#?
Define a partial class?
Can an abstract class have a constructor c#?