Recursion function using Factorial in C#

How to Find Factorial using Recursion  in C#

Introduction : Using this programe you can find the factorial Number from  The Number enter by  user.
 
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace factorial
{
    class Program
    {
        static void Main(string[] args)

            {

            Console.WriteLine(" Enter Number: ");

            long n = Convert.ToInt64(Console.ReadLine());

            Console.WriteLine
(" The Factorial  is: " + GetFactorial(n));

            Console.ReadKey()
;

            }

           public static long GetFactorial(long Num)
           {
            if (Num <= 1)

            return 1;

            else

            return Num * GetFactorial(Num - 1);

           }
    }
 



See Other Tutorial :

*  AngularJS Crude With ASP.NET MVC

*  Convert Rows to columns using 'Pivot' in SQL Server

*  Mvc Registration page With user exist using Ajax method

*  MVC 4 How to Perform Insert Update Delete Edit Select Operation

*  MVC4 Edit,update,Delete,cancel inside gridview using sql database

*  MVC 4 Gridview To Display Data Using SQL Server Database With Simple code 

*  Login page in asp.net Mvc4 Web application

*  Mvc4 How to bind Dropdown List using Sql Database


Gridview find control in asp.net
Previous
Next Post »