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

Basic concepts, what is the diffeerence between c and c++

what is the diffeerence between c and c++

Program, write a program that adds all numbers from 1 to 200

write a program that adds all numbers from 1 to 200

I want rss feed from emails, Project Description: I am trading binary op...

Project Description: I am trading binary options and need my signals that are sent to me via email to be sent to my followers via an RSS feed I have no idea how rss feeds imp

Program that will recursively prompt for input from the user, BACKGROUND: F...

BACKGROUND: FILE SYSTEMS  In a computer, a file system (sometimes written filesystem) is the way in which files are named and where they are placed logically for storage and ret

What is abstraction?, What is abstraction? - Simplified view of an obje...

What is abstraction? - Simplified view of an object in user's language is termed as abstraction. - It's the simplest, well-defined interface to an object in OO and C++ which

Playback pattern sequences, This task involves creating a new class(es) tha...

This task involves creating a new class(es) that will allow the system to playback pattern sequences using the Neo  Freerunner  hardware. The first thing to note is that the vibrat

Define bitwise-and operator, Define Bitwise-AND Operator: &:? The bitwi...

Define Bitwise-AND Operator: &:? The bitwise-AND operator (&) compares every bit of its first operand to the corresponding bit of its second operand. If both bits are 1 the mat

Padovan stringf, A Padovan string P(n) for a natural number n is defined as...

A Padovan string P(n) for a natural number n is defined as: P(0) = ‘X’ P(1) = ‘Y’ P(2) = ‘Z’ P(n) = P(n-2) + P(n-3), n>2 where + denotes string concatenation.

Computes the area of a circle of radius r, (a) Write a procedure called (ar...

(a) Write a procedure called (area-of-rectangle h w) that computes the area of a rectangle of height h and width w. (b) Write a procedure called (area-of-circle r) that computes

Destruction of array object, What's the order that objects in an array are ...

What's the order that objects in an array are destructed? Need assistance please explain it with example.

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