my sample input is providing the right answer but none of my test cases are right. Can you please find the problem. My code is in the submissions.
Broken calculator problem
hi
share your code…
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.
#include using namespace std; int main() { int n; cin>>n; int a=1; for(int i=1;i<=n;i++) { a=a*i; } cout<<a; return 0; }
can you please tell why this code isn’t working
hi @Tushar-Goel-1587999611286693 this code will not work for very big numbers such as 100! because c++ does not have any datatype that can store such big numbers.
So, are we to leave this question?
@Tushar-Goel-1587999611286693 what gave you that impression? The problem is there for a reason. It has unique constrainst so its upto you to figure out how to get around them. Let me know if you need a hint.
Thanks for the help, got it, there is need to make a long array and get to the basic of the multiplication