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
Explain some String Oriented Library Functions? To make simpler string processing we can use special string oriented library functions. Mainly the C compilers include library f

Aim: To implement a program to add two complex numbers using constructors. Code:                       class complex {             int real;             int img;

write a C rpogram that can display the transpose form of a ciphertext matrix.Prompt users to provide row and coloumn number of matrix.Then user will input plaintext and the program

In this Lab you will code 8086 assembler equivalents (Virgo) for common C control flow instructions. This will give you an appreciation for how control flow is implemented in assem

i have an array of structs, and am trying to make a pointer that can point to a certain struct within the array

Ba s i c r u l e s o f C + + p r o g r a m : ·     I t m u s t h a v e o n l y o n e m a i n f u n c ti o n ·

Prepare data from fixed OCR areas scanned. Project Description: Project is to design software which can use character recognition only on certain areas of scanned pdf's/ jpeg

Difference between Echo and print statement. print()and echo() are language constructs in PHP, both are used to output strings. Both statements are of almost same Speed. ech

Multidimensional Arrays - Every dimension is specified in separate brackets e.g. int arr[4][3]; This is a two-dimensional array with 4 as row dimension and 3 as

how to create database of faculty database......... send me with program