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


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

Gardening for Insects

119G2024

Motion in Two Dimensions - Chapter 4

Lab Manuals - Experiment - Study of Transistor’s Characteristics Common Emitter

2E12024

IT Essentials: PC Hardware and Software Companion Guide by Cisco Networking Academy

Lecture 0 C - Casting Processes - Manufacturing Processes

Atlas of World History

What Is Physics ? by David Halliday

Electric Machinery Fundamental Lab

0429 MASS EDUCATION LITERACY

Industrial Control system

Electric Circuit LAB MANUAL

Calculus

Universal Gravitation - Chapter 13

Hadith Nawawi

Quantum Physics (UCSD Physics 130)

Make a geometry on FUSION 360, generate GCODE file and run on SSCNC Simulator

62D2024

Ilmi English Literature Objective Book PDF for PCS

Power Transmission Distribution & Utilization

LM555 Timer

Lecture 5 - Types of Distributed Database - Distributed Database Design

JavaScript® For Kids For Dummies

113G2024

Physics All Chapters - ECAT Entry Test Preparation

Data Analysis with Microsoft Excel by Kenneth N. Berk

chapter 45 applications of nuclear physics

Supplement Problems Equilibrium in 3D - Engineering Statics

Thermodynamics : An Engineering Approach By Cengel , Yunus

Basic Engineering Circuit Analysis Chapter 4

chapter 46 particle phyics and cosmology

chapter 24 gausss law

133G2019

Lecture 2 - Data Mining on What Kind of Data? - Data Mining

A Handbook of Native American Herbs

Distributed Forces - Flexible Cables - Engineering Statics

28H2025

21H2023

123G2024