Skip to content

TRUEANGLE

BEAUTY AND PLAY

  • DOLLECT
  • Others
  • Configuration
  • AI
  • BLOG
  • ABOUT
    • ABOUT
    • Perception Style

How to write an algorithm to find factorial of a given number ?

Posted byjeffrin August 21, 2014
#include <stdio.h>

factorial()
{

int p = 1;
int i = 1;
int n;
printf("Enter a Number greater than 0 \n");
scanf("%d",&n);
while ( i <= n)
{
p = p * i;
i = i + 1;
}

printf("Factorial of the input is %d \n",p);
}
Posted byjeffrinAugust 21, 2014Posted inC, mathematics, Programming LanguagesTags: factorial

Post navigation

Previous Post Previous post:
Hacking with an algorithm to find prime factor of a number
Next Post Next post:
Hacking with debian netselect-apt command
August 2014
M T W T F S S
 123
45678910
11121314151617
18192021222324
25262728293031
« Jul   Sep »
TRUEANGLE, Proudly powered by WordPress.