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 / diana cheriyan

Using System;
Namespace FactNmspce
{
Class FactCls
{
Public Static Void Main(String[]args)
{
int i,n,fact=1;
Console.WriteLine("Enter Number");
n=int.Parse(Console.ReadLine());
for(i=1;i<=n;i++)
{
fact=fact*i;
}
Console.WriteLine("Factorial is {0}",fact);
}
}
}

Is This Answer Correct ?    12 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you concatenate in c#?

928


What is a dimensional array?

852


What do you know about Translate Accelerator?

1088


Can we use "this" command within a static method?

999


What is the purpose of dictionary in c#?

898


Is arraylist generic in c#?

886


How are delegates chosen?

891


Distinguish between the Debug class and Trace class with its functionality?

1007


Can you store strings in arrays?

976


Explain About namespaces

986


What is string pool in c#?

1008


Explain how obfuscator works in .net

1004


What is datatable and dataset in c#?

1005


Why is c# a good programming language?

1002


What is the difference between abstraction and encapsulation in c#?

951