Logo 
Search:

C Programming Articles

Submit Article
Home » Articles » C Programming » Homework HelpRSS Feeds

Program to find the factorial of a given number using function declaration

Posted By: Lujza Fischer     Category: C Programming     Views: 32145

Write a program to find the Factorial of a given
number using Function declaration.

Code for Program to find the factorial of a given number using function declaration in C Programming

#include <stdio.h>
#include <conio.h>
void main()
{
int n,x;
int fun(int);
printf("enter  any no...");
scanf("%d",&n);
x=fun(n);
printf("factorial of %d is %d ",n,x);
getch();
}
fun(int z)
{int fact=1;
for(;z!=0;z--)
  { fact*=z ;
  }
 return(fact);
}
  
Share: 



Lujza Fischer
Lujza Fischer author of Program to find the factorial of a given number using function declaration is from Frankfurt, Germany.
 
View All Articles

 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!