Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

write code for Factorial?

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


Please Help Members By Posting Answers For Below Questions

What are the different states of a thread?

929


What is the use of oops in c#?

912


What is the base class in .net from which all the classes are derived from?

953


Is java better than c#?

937


Explain About Web.config

976


What are primitive data types in c#?

943


Explain the difference between the debug class and trace class?

893


What is the purpose of escape sequence?

1022


What is datagrid c#?

946


Can namespace contain the private class?

937


Why delegates are required?

971


How do I get deterministic finalization in c#?

1066


Is char * null terminated?

935


What is action c#?

916


What is default method in c#?

1035