Friday 20, July 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
 
Convert decimal number to binary number in c
This c language program will input an integer in decimal numbers system and convert it to binary numbers system. Decimal to Binary Conversion, Convert from decimal to binary using c language....more »
Category : C Programs Hits : 4755
   
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 : 1947
   
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 : 3686
   
arrays and pointers in c
An example code for arrays and pointers in c language....more »
Category : C Programs Hits : 2022
   
Check the given year is leap or not using c
This program will input a year and check whether it is a leap year or not....more »
Category : C Programs Hits : 3589
   
   
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 IM Marketing Miracle Ebook IM Marketing Miracle
   
Download Function Point Training and Analysis Manual  Ebook Function Point Training and Analysis Manual
   
Download Introduction To Programming With Java  Ebook Introduction To Programming With Java
   
Download Top SEO Secrets  Ebook Top SEO Secrets
   
Download Algorithms for Programmers  Ebook Algorithms for Programmers
   
Studiesinn.com 2018 All Rights Reserved.