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 difference between and xml documentation tag?

903


Explain how to implement delegates in c#.net

896


What is the interface in c#?

906


What is unsigned int?

845


What is the use of console readkey in c#?

873


Can abstract class have constructor?

815


What is sqldatareader c#?

819


Does c# support properties of array types?

880


What is event sourcing in c#?

922


Is constructor a static method?

940


Explain attributes in c#?

788


What is the use of 'as' Keyword in C# ?

963


Can we declare class as protected?

920


what is a enumeration in c#

988


How long can a string be c#?

847