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

Assignment Help:

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


Related Discussions:- C program for function of find the factorial

Area under curve, progarm in c for area under curve   #include ...

progarm in c for area under curve   #include float start_point, /* GLOBAL VARIABLES */ end_point, total_area; int numtraps;

Recursive function, Write a recursive function recursiveMin that takes an i...

Write a recursive function recursiveMin that takes an integer array, a starting subscript and an ending subscript as arguments, and returns the smallest element in the array. The

Functions overloading, Functions Overloading This a capability in which...

Functions Overloading This a capability in which a C++ program can have several functions performing similar tasks on different data types. When an overloaded function is calle

Pebble merchant, simple coding for pebble merchant..

simple coding for pebble merchant..

Function with two arguments, Write out pseudocode for a function called "an...

Write out pseudocode for a function called "and" that takes two arguments, both booleans, and returns the logical and of the inputs. DO NOT use the logical and operator: instead, w

C program that controls the uart, Objective: Construct a C program tha...

Objective: Construct a C program that controls the UART, and is capable of displaying strings. Echo characters received on the UART to the LCD screen Outcome: A mess

How many ways are there to initialize an int with a constant, There are two...

There are two ways for initializes in C++ as shown in the example that follows. The first way uses the traditional C notation. The second way uses constructor notation. int foo

Title, #questionAt a shop of marbles, packs of marbles are prepared. Packet...

#questionAt a shop of marbles, packs of marbles are prepared. Packets are named A, B, C, D, E …….. All packets are kept in a VERTICAL SHELF in random order. Any numbers of packets

Algorithm and flowcharts, algorithm to find out all the factors of given po...

algorithm to find out all the factors of given positive integers

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd