Friday 20, April 2018
Welcome Guest, Register | Login  
      Home       Tutorials       Free Ebooks       Free Scripts       Tech News       Articles       About Us       Blog        Forum

  Find Factorials using Recursion in c

This c program will use recursive function and calculate the factorial of given number.
Cut & Paste Script
#include <stdio.h>

unsigned long factorial(unsigned long);

int main(void)
{
  unsigned long number = 0L;
  printf("\nEnter an integer value: ");
  scanf(" %lu", &number);
  printf("\nThe factorial of %lu is %lu\n", number, factorial(number));
  return 0;
}

unsigned long factorial(unsigned long n)
{
  if(n < 2L)
    return n;
  else
    return n*factorial(n - 1L);
}
   
     RELATED SCRIPTS
 
C program to join two strings without using strcat
This c language program will join two strings without using strcat string function....more »
Category : C Programs Hits : 2258
   
C Program to Reverse an array
Here is a program which will take input from user in array and will reverse it using c language....more »
Category : C Programs Hits : 1885
   
Compare two strings using c
This program will input two strings and compare them. It will show both strings are equal, first string is greater than second or first string is less than second....more »
Category : C Programs Hits : 1700
   
Printing triangle of numbers using c
Here is the source code for printing triangle of numbers using c language. In this example user will input a number, it will start from 1 and will go to the give number.
1
2 3
4 5 6
7 8 9 10...more »
Category : C Programs Hits : 2833
   
Print fibonacci series using c language
Here is a c language program which will take number of terms as input from user and prints the fibonacci series using c language loops....more »
Category : C Programs Hits : 3597
   
   
SCRIPT CATEGORIES
 
  C Programs
C Programs scripts
  C++ Programs
C++ Programs scripts
  Java Programs
Java Programs scripts
  JavaScript Examples
JavaScript Examples scripts
  PHP Examples
PHP Examples scripts
  VBScript Examples
VBScript Examples scripts
 
 
 
POPULAR E-BOOKS
 
Download The 7 Great Lies Of Network Marketing Ebook The 7 Great Lies Of Network Marketing
   
Download Video Marketing Tactics Using Ebook Video Marketing Tactics Using
   
Download  The 6 Dirty Little Secrets They Don't Want You To Know About Network Marketing Ebook The 6 Dirty Little Secrets They Don't Want You To Know About Network Marketing
   
Download Blueprints for a successful presentation  Ebook Blueprints for a successful presentation
   
Download The Affiliate Marketers Master Guide Ebook The Affiliate Marketers Master Guide
   
Studiesinn.com 2018 All Rights Reserved.