0% found this document useful (0 votes)
22 views1 page

Lab C++

The program asks the user to enter a positive integer, computes the factorial of the entered number by multiplying all integers from 1 to the entered number, and displays the result.

Uploaded by

Luh Strong
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views1 page

Lab C++

The program asks the user to enter a positive integer, computes the factorial of the entered number by multiplying all integers from 1 to the entered number, and displays the result.

Uploaded by

Luh Strong
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Write a c++ program that will print the number entered by the user.

The factorial of a number is the product of all the integers from 1 to that number. The factorial can only
be defined for positive integers. The factorial of a negative number doesn't exist. And the factorial of 0 is
1. For example, The factorial of a positive number n, say 5, is denoted by 5! and is given by: 5! = 1 * 2 * 3
* 4 * 5 = 120. Write a c++ program asking the to enter a positive integer. Then the factorial of that
number should be computed and displayed on the screen.

You might also like