Back To C++ User Defined Functions Index
//program to create a function to find factorial of number passed to function as argument #include
void factorial(int); //function declaration void factorial(int a) //function definition { int fact=1; int i; for(i=1;i<=a;i++) { fact=fact*i; } cout<<"factorial of number is "<
>a; factorial(a); //calling the function getch(); }