Program that calculate the factorial value of any number by using functions

Program that calculate the factorial value using functionsProgram that calculate the factorial value of any number by using functions

Object: Write a function to calculate the factorial value of any integer entered through the keyboard. C++ projects for beginners with source code

Code:

#include<iostream>
#include<conio.h>
using namespace std;

int fac(int num);

void main()
{
int nu;
cout<<“\nEnter Any Number: “;
cin>>nu;
cout<<fac(nu);
getch();
}
int fac(int num)
{
int i,fact=1;
for(i=num;i>=1;i–)
{
fact=fact*i;
}
cout<<“\nFactorial of given Number is: “;
return fact;
}

Output:

Program that calculate the factorial value of any number by using functions

M.A Siddiqui

Hi, I am M.A Siddiqui. I'm a Computer Science Student, In this website, I'm teaching you Multiple languages and provides Projects and other Subjects Notes.

You may also like...

1 Response

  1. June 14, 2020

    […] Program that calculate the factorial value of any number by using functions […]

Leave a Reply

Your email address will not be published. Required fields are marked *