You are viewing a single comment's thread. Return to all comments →
This is my c++ program
void extraLongFactorials(int n) { int num; num = n; int len,carry,realnum,newnum,c; deque<int> a ; deque<int> temp; a.push_back(num); for (int i = 2; i < num ; i++) { len = a.size(); temp.clear(); carry = 0; for (int j = len-1; j >= 0 ; j--) { newnum = carry + (i * a[j]); temp.push_front(newnum % 10); carry = newnum / 10; } if (carry!=0) { while (carry!=0) { temp.push_front(carry%10); carry /= 10; } } a.clear(); a = temp; } for (int i = 0; i < a.size() ; i++) { cout << a[i] ; } }
Seems like cookies are disabled on this browser, please enable them to open this website
Extra Long Factorials
You are viewing a single comment's thread. Return to all comments →
This is my c++ program