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
What is the difference between xml documentation tag?
Explain how to implement delegates in c#.net
What is the interface in c#?
What is unsigned int?
What is the use of console readkey in c#?
Can abstract class have constructor?
What is sqldatareader c#?
Does c# support properties of array types?
What is event sourcing in c#?
Is constructor a static method?
Explain attributes in c#?
What is the use of 'as' Keyword in C# ?
Can we declare class as protected?
what is a enumeration in c#
How long can a string be c#?