Discussions Events Study Material Jobs
Write a Program that inputs a number in main function and passes the number to a function. The function displays factorial of that number.

Search Books

For Better Search Results Only Write Subject OR Topic Name Like ( Math , Physics , Database , Algorithm ).



Write a Program that inputs a number in main function and passes the number to a function. The function displays factorial of that number.

Write a Program that inputs a number in main function and passes the number to a function. The function displays factorial of that number.

Description: #include
#include

void factorial (int n);

void main ( )
{
int num;
clrscr ( );
cout <<"Enter a number: ";
cin >> num;
factorial (num);
getch ( );
}



void factorial (int n)
{
int i;
long fact;
fact = 1;
for (i = 1; i<=n; i++)
{
fact *= I;
cout<<"Factorial of "<< n << "is "<< fact;
}
}


Please Login / Signup to Continue Download Study Material


Login to Continue Download
Disclaimer

Uniwaly does not host or upload any files including books, notes, past papers, or other educational materials. All content is provided through publicly available links from third-party websites such as Google Drive, Dropbox, and other file-sharing platforms. We respect copyright laws and recommend users to only download content that is freely available or shared with permission. If you believe any file violates copyright, please contact us immediately for review.


More Study Materials

Sound Waves - Chapter 17

4000 Essential English Words 6 Page 3 4000 Essential English Words

Algorithmic Mathematics

Proteus Circuit - Parallel pdsprj File

Building Arduino Projects for the Internet of Things

Data Analysis with Microsoft Excel by Kenneth N. Berk

Electronics Devices and Circuits Assignment

Introduction to SAT II Physics

31J2023

Chinese Language

46H2024

Teacher Education in Physics

PHYSICS PROBLEM SOLVING IN COOPERATIVE LEARNING GROUPS by Dr. Mark Hollabaugh

Number System & Boolean Algebra SN-2 Notes

23J2024

Introduction to Smart Grids

Labs of Introduction to Computing

Fundamentals Of Electric Circuits 10th Edition

Mathematical Physics

24B2023

Physical Pharmacy

chapter 26 capacitance and dielectrics

Application of Friction - Wedges & Screws - Engineering Statics

DC Power Supply Circuits 1 Output Result

138G2024

Lab Graphs - Book 1 & 3 Microsoft Excel File - Electric Devices

133G2019

61H2024

Lab Graphs - Book 1 EDC 1.2 Microsoft Excel File - Electric Devices

Data Structure Lab

Introductory Physics 2 - Duke University by Robert G. Brown

Slides - Week 13 and 14 - Heat Transfer - Fundamentals of Thermal Sciences

Write a Program that inputs a number in main function and passes the number to a function. The function displays factorial of that number.

119G2024

27J2023

62G2021

Slides - Lecture 11 - Applied Thermodynamics

128G2024

Shepherding a Child's Heart by Tedd Trip

chapter 39 relativity