+ 1
Please review .
#include <iostream> using namespace std; int main() { int x , m; cin>>x; while (x>=1) { m=x-1; x=x*m; } m=x; cout<<"factorial is "<<x; }
3 odpowiedzi
+ 7
welcome 😊
+ 2
thanks , I tried . and its working .
#include <iostream> using namespace std; int main() { int x , m; cin>>x; while (x>=1) { m=x-1; x=x*m; } m=x; cout<<"factorial is "<<x; }