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 are the generation of Garbage Collection in C# .NET ?
What does readonly mean in c#?
What is difference between dll and exe in c#?
Explain different properties of object oriented systems.
what is IDisposal interface,IComparable,IEquatable,IFormatable
What's the difference between abstraction and encapsulation?
Can a constructor be static in c#?
What is an indexer in c#?
Can we overload the main method in c#?
Difference between type constructor and instance constructor? What is static constructor, when it will be fired? And what is its use?
What is gac? What are the steps to create an assembly and add it to the gac?
Can I define a type that is an alias of another type (like typedef in c++)?
What types of object can I throw as exceptions?
Why do we need interfaces in c#?
Describe a Struct ?