My solution: https://ide.codingblocks.com/s/416050
Question: https://online.codingblocks.com/app/player/178555/content/173713/4855/code-challenge
My solution: https://ide.codingblocks.com/s/416050
Question: https://online.codingblocks.com/app/player/178555/content/173713/4855/code-challenge
Hey @mohaktrivedi pow won’t work because Sometimes pow function leads to overflow of data type.
You can take this code for reference and implement it like this, also numbers are very very big so use long long int instead of int, rest everything seems correct.
@mr.encoder Thank you! The comments helped me understand it in a simple way 
so thanks for clear ad precise comments. How did you know that pow() won’t work. From where have you prepared your basics? I guess I’m having some gaps in my basics knowledge of cpp. What should I do to fill in those gaps?
I came to know about the limitations of pow() when i did this question
To prepare basics i would suggest you to do as much questions as you can, mathematical too. More questions , crystal concept clarity.
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.