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
Full time contractual programming position (mostly scraping, databasing) Project Description: This is a full time contractual role needed for a sports advisory service. We ar

I am looking individuals who have company experience working on Jquery and Microsoft Technology ( MVC 4.5 ), who will take live online session and provide training through Team Vie

I want C# routines for website back end Project Description: We want some routines written in C# (.NET) to: * Parse some RESTful APIs to transform and push data to RabbitM

Need to copy values from one database to another AND Enhancements in MVC website. Project Description: Basically, you are asked to create an app that copy values from one DB

Project Description: We require some routines written in C# (.NET) to: * Parse several RESTful APIs to change and push data to RabbitMQ * Pop objects from RabbitMQ and inp

What is a DataReader object? The DataReader object helps in retrieving the data from a database in a forward-only, read-only mode. The base class for all the DataReader objects

What are the features of ADO.Net ?  ADO.NET features: 1. Disconnected Data Architecture 2. Data cached in Datasets 3. Data transfer in XML format 4. Interaction wit

I need CELL PHONE PINGING for fugitive tracking Project Description: I want an application like the following: it provides cell phone pinging(location information via gps) wi

The program is broke now but explains in text and printscreens the specific things i have to do to implement new bookies new sports and change settings for looking for arbs on two

Project Description: Looking for a JQuery expert that will develop a customizable product selection page to work with our asp.net website. Product selection, size, quantity, pri