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
Is namespace necessary in c#?
What is parallel foreach in c#?
What are the types of methods in c#?
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?
What is icomparable in c#?
What are the Types of caching
How long can a string be c#?
Explain the three services model (three-tier application). Presentation (ui), business (logic and underlying code) and data (from storage or other sources).
What is class and object c#?
Do loops in c#?
Why do we use stringbuilder in c#?
code for arranging given number in possible permutation ways ex:123,321,312,132,231,213.
How do I create a multilanguage, single-file assembly?
What is a boolean c#?
What is the symbol used for in c#?