c program for function of find the factorial


C Program for FUNCTION OF FIND THE FACTORIAL

float factorial(float);

void main()

{

          float i=0,c=0;

          clrscr();

          printf("ENTER THE DIGIT TO FIND THE FACTORIAL: ");

          flushall();

          scanf("%f",&i);

          c=factorial(i);

          printf("THE FACTORIAL OF %f IS %f",i,c);

          getch();

}

float factorial(float i)

{

          float j=0,k=1;

          for(j=1;j<=i;j++)

          {

                   k=k*j;

          }

          return(k);

}

OUTPUT :

ENTER THE DIGIT TO FIND THE FACTORIAL : 5

THE FACTORIAL OF 5 IS 120.000

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: c program for function of find the factorial
Reference No:- TGS0159426

Expected delivery within 24 Hours