Q:

C Program to find the factorial of a given number using pointers

0

C Program to find the factorial of a given number using pointers

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

#include <stdio.h>
void findFact(int,int*);
int main()
{
         int fact;
         int num1;
			
		printf(" Input a number : ");
		scanf("%d",&num1);		 

         findFact(num1,&fact);
         printf(" The Factorial of %d is : %d \n\n",num1,fact);
         return 0;
        }

void findFact(int n,int *f)
		{
        int i;

       *f =1;
       for(i=1;i<=n;i++)
       *f=*f*i;
       }

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now