i am not able to figure it out where did i am going wrong
my code - https://ide.codingblocks.com/s/144232
Not able to identify the mistake
Hello @kushal1998,
-
The stoi() would not work for the numbers greater than the range of int.
Solution:
Explicitly convert the string into a number.
Hint: using a loop -
Both the for loops inside the isCBN() function should iterate from 0 to 9. Correct it.
-
parameter of substr() function is wrong.
the second parameter is length, not the ending index.
I have corrected point 2. and 3.
Also correct it for point 1. to remove the run-time error.
Hope this would help.
Give a like, if you are satisfied.
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.