https://ide.codingblocks.com/s/166432 sir my code is giving correct output till 33 .why it is not giving correct output after 33
2. ) is my approach is correct if not then what is the correct approach and what’s wrong in my approach is correct
Factorial of long number
@pankajsingh Make sure that at each vector location you cannot store very large numbers(even long long int variable cannot store that).
In your code if you change line 6 to long long int n,x,carry=0; and line 8 to vector< long long int >v;
You will notice that your code will give correct answer for 35 but still for larger test cases your code will fail.
So Idea is to store only one digit of result at each vector location. Keeping this in mind, dry run your code and make some changes such that each vector location stores only one digit.