Find out the factorial - c# program, DOT NET Programming

Find out the Factorial - C# Program

I've been trying so many codes for this but those codes didn't work well. Please write the code for find out the factorial of an integer number in C#.

Posted Date: 2/11/2013 11:49:04 PM | Location : United States





Try this code, it will help you.

Program of Finding Factorial

using System;  

class Factorial

{

  public static void Main()

 {

   int no,i,fact=1;

  Console.Write("Enter a number to find its factorial : ");

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

   if (no != 0)

  {

    for (i = no; i>=1; i--)

   {

    fact = fact * i;    

   }

   Console.WriteLine("Factorial = " +fact);

  }

   else

  {

   Console.WriteLine("You entered 0, not valid.");

  }  

  Console.ReadLine();

 }

}

Posted by Jermy | Posted Date: 2/11/2013 11:50:30 PM

Thank you for this code i really works well, you are doing great job.

Posted by Stephen | Posted Date: 2/11/2013 11:51:03 PM


Related Discussions:- Find out the factorial - c# program, Assignment Help, Ask Question on Find out the factorial - c# program, Get Answer, Expert's Help, Find out the factorial - c# program Discussions

Write discussion on Find out the factorial - c# program
Your posts are moderated
Related Questions
What is shadowing? When 2 elements in a program have similar name, one of them can hide and shadow the one. Therefore in such cases the element which shadowed the main element

What is the purpose of DOTNET? Dot Net Is a collection of products like C#, ASp.Net, Vb.Net, XML. The purpose of .Net is that we can simply upgrade and degrade our programs whi

What is the relation between Classes and Objects? The class & object look very much same but are not same. The Class is a definition, while object is a instance of the class cr

What is Query String and what are their benefits and limitations? The query string is the information sent to the server appended to the end of a page URL. The benefits of u

I need C# Programmer Project Description: To help in the production of a C# module to provide a web service. We are based in Littlehampton, West Sussex. Skills required ar

Project Description: We want to design and develop a new Sportbook Platform from scratch, subsequent functionality: - Have a full functionality like other similar websites (S

Can a .NET web application consume Java web service? Yes Offcourse.Actually Webservices are independent  to language. It depends on WSDL and SOAP. so any one can develope the W

I would like to develop a new website to compete with an existing one: greatandhra I would like the new website to be less flashy, more content driven and be inspired from below

Define XPATH. XPATH is an XML query language to select specific section of an XML document. By using XPATH you can address or filter elements and text in a XML document. For il

I have the project that takes screen shots and saves in the specific folder.(eg.Screen0001) but the problem is that if i close application and run it again then it replace the exis