We are providing online training of realtime Live project on Asp.Net MVC with Angular and Web API. For more information click here. If you have any query then drop the messase in CONTACT FORM

Sunday, June 7, 2015


->Write a program to find the factorial of input the given number ?

class Program


{ 
static void Main(string[] args)

{
int i, number, fact;

Console.WriteLine("Enter the number");

number = int.Parse(Console.ReadLine());

fact = number;
for (i = number - 1; i >= 1; i--)

{
fact = fact * i;

}
Console.WriteLine("Result: {0}",fact);

Console.ReadLine()

}

}

OUTPUT:
Enter the number
5
Result: 120
 



No comments: