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

Is namespace necessary in c#?

970


What is parallel foreach in c#?

1020


What are the types of methods in c#?

1051


If I have more than one version of one assemblies, then how'll I use old version (how/where to specify version number?)in my application?

975


What is icomparable in c#?

1011


What are the Types of caching

1055


How long can a string be c#?

959


Explain the three services model (three-tier application). Presentation (ui), business (logic and underlying code) and data (from storage or other sources).

964


What is class and object c#?

951


Do loops in c#?

941


Why do we use stringbuilder in c#?

972


code for arranging given number in possible permutation ways ex:123,321,312,132,231,213.

2228


How do I create a multilanguage, single-file assembly?

971


What is a boolean c#?

944


What is the symbol used for in c#?

996