Welcome to our blog post In this program, we will learn program how to find factorial of a given number using C++ program? Here, we will implement this program with and without using user define function.
Logical Part of program:
- Input a number
- Initialize the factorial variable with 1
- Initialize the loop counter with N (Run loop from number (N) to 1)
- Multiply the loop counter’s value with factorial variable
using namespace std;
long int fact=1;
cout<<“Enter an integer number: “;
cout<<“Factorial of “<<num<<” is = “<<fact<<endl;
Enter an integer number: 6
Factorial of 6 is = 720
Program to find the sum of each row & column of a matrix of size n x m andif matrix is square, find the sum of the diagonals also.
So I hope that you learn about the How to find factorial of a given number using C++ program.And if you have any more queries about computer relegated then feel free to discuss your problem in the comment section.
Thank you so much and come back for more updates about Techgsr.co