C program for function of find the factorial , C/C++ Programming

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

Posted Date: 9/10/2012 8:01:33 AM | Location : United States







Related Discussions:- C program for function of find the factorial , Assignment Help, Ask Question on C program for function of find the factorial , Get Answer, Expert's Help, C program for function of find the factorial Discussions

Write discussion on C program for function of find the factorial
Your posts are moderated
Related Questions
Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b

3 kilograms of peebles are needed for converting an area of 1 square meter.the rate of the peeble is 5 per kilogram


Described the differences among a C++ struct & C++ class? A: The default member & base class access specifies are distinct. It is one of the commonly misunderstood aspects of C+

d county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various luminous jewels of particular colour. Necklaces

Description - The TR-069 CPE WAN Management Protocol (CWMP) is a protocol that was created by the Broadband Forum (formally the DSL Forum) which sets out a common method for CPE de

#question.develop an algorithm using pseudocode for computing cos(x) and sin(x). use a sentinel controlled while loop. use the series definition of e^+-jx

write a program to generate padovan sequence in c++

Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various luminous jewels of particular colour. Nec

Illustration of Plot function: To be more common, the script could prompt the user for the time and temperature, instead of just assigning the values. Then, the axis function