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

What is the purpose of namespace?

864


Why static variables are used?

1015


What are the generation of Garbage Collection in C# .NET ?

949


Which is better javascript or c#?

910


What are the delegates in c#?

942


Explain dataset.acceptchanges method in .net?

947


What is ulong in c#?

1025


What is difference between struct and class in c#?

909


How big is a 64 bit integer?

886


What is difference between ilist and list?

893


Explain the concepts of cts and cls(common language specification).

964


What are PE(Portable Executable)?

1032


What is lock statement in C#?

997


In C#, explain the difference between overloading and overriding.

1121


What are generic types?

932