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 purpose of namespace?
Why static variables are used?
What are the generation of Garbage Collection in C# .NET ?
Which is better javascript or c#?
What are the delegates in c#?
Explain dataset.acceptchanges method in .net?
What is ulong in c#?
What is difference between struct and class in c#?
How big is a 64 bit integer?
What is difference between ilist and list?
Explain the concepts of cts and cls(common language specification).
What are PE(Portable Executable)?
What is lock statement in C#?
In C#, explain the difference between overloading and overriding.
What are generic types?