Discussions Study Material
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

2J2024

california

21H2024

No-Drama Discipline: The Whole-Brain Way to Calm the Chaos and Nurture Your Child's Developing

Labs : Industrial Control System

2J2025

31H2024

Urdu Manual Book for PSER Door to Door Survey

Computer Networking A Top Down Approach - James F. Kurose , Keith W. Ross

Lecture 6 B - METAL FORMING CONTINUE - Manufacturing Processes

Wilson and Gisvold's Textbook of Organic Medicinal and Pharmaceutical Chemistry

Lecture 6 A - METAL FORMING - Manufacturing Processes

PHP, MySQL, JavaScript & HTML5 All-In-One For Dummies

Lecture 11 - Clustering - Data Mining

Ordinary Differential Equations

101 Healing Stories for Kids and Teens

Lecture 7 - Powder metullurgy - Manufacturing Processes

115G2024

Chemistry All Chapters - ECAT Entry Test Preparation

Bangkok - Lonely Planet

Solutions Manual of Thermodynamics

Electromagnetics and its Application

65J2024

Islamic Studies

59H2024

54H2024

2H2019

49J2024

0427 PAKISTANI ADAB-I

23J2023

0131 Micro Economics

Proteus Circuit - pdsprj File - Workspace Code

To calculate the voltage gain of CE amplifier Lab

38H2024

Oscillations and Mechanical Waves

Digital Signal Processing ( UET All Lectures )

8J2025

63J2024

One Dimensional Heat Eqaution

Lecture 12 - Query Decomposition and Data localization - Distributed Database Design