Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Please, Don't Miss Visit My Site:
- https://global-prog.com
- */
- #include <iostream>
- #include <math.h>
- #include <corecrt_math_defines.h>
- using namespace std;
- int f = 1;
- int x,y;
- int main()
- {
- cout << "Enter your number to get \"!\" : ";
- cin >> x;
- y = x;
- while (x != 0) {
- f *= x--;
- }
- cout << "Factorial of " << y << " is = " << f << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement