Find factorial using loop in C++
###### Posted by Samath
Last Updated: November 02, 2014

Develop a C++ console application that uses a loop to find the factorial of an accepted integer number.

Here is the Solution to the problem above:

```#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
int n, count;
int factorial=1;
cout<<"Enter an integer: ";
cin>>n;
if ( n< 0)
cout<<"Invalid Value! Please enter a value greater than 0";
else
{
for(count=1;count<=n;++count)
{
factorial*=count;
}
cout<<"Factorial of "<<n<<" is "<<factorial;
cout<<endl;
}
return 0;
}
```
###### Find the Factorial of Number using Python
gideonna | Apr 13, 2016
###### Write a Python function to find the factorial of a number.
MaryJns | Aug 13, 2024
###### C Program to Find Factorial of a Number Using Recursion
Samath | Jan 02, 2017
###### C Program that Print First 10 Natural Numbers using For, While and Do-While Loop
Samath | Jan 02, 2017
###### How do you reverse a string without using a loop in Python?
RoseHrs | Aug 19, 2024
###### Java program that uses a loop to compute the sum of all even numbers between 2 and 100 (inclusive)
Samath | Apr 03, 2022
###### Javascript program that check if a word is palindrome using one for loop
SceDev | Feb 17, 2024
###### How do you find the sum of elements in a list using a loop in Python?
FrankMl | Aug 13, 2024
###### How can you find the sum of elements in a list using a while loop in Python?
HenryPk | Aug 18, 2024
###### How can you find the sum of elements in a list using a for loop in Python?
EveClark | Aug 17, 2024
###### Java program that uses a loop to compute the sum of all squares between 1 and 100 (inclusive)
Samath | Apr 03, 2022
###### Java program that uses a loop to compute the sum of all even numbers between a and b (inclusive), where a and b are inputs
Samath | Apr 03, 2022
###### Java program that uses a loop to compute the sum of all odd digits of an input. (For example, if the input is 32677, the sum would be 3 + 7 + 7 = 17.)
Samath | Apr 03, 2022
###### How do you implement error handling within a cursor loop using TRY...CATCH blocks?
NickCrt | Aug 06, 2024