Code not running


the code is not running on IDE

updated code: https://ide.codingblocks.com/s/211994

please have a look.
rate and resolve it if satisfied.
thanks

could you please highlight the mistakes in my code

2 main issues:

  1. function parameter is char*, while you are passing a string to it. you can use c_str() function to convert a string to const char*
  2. as the string can be of length 10, we need long to store the data. so convert those arithmetic operations into long, I used 10L… 10 is integer while 10L is long although they have same value 10.
  3. single quotes used in ‘0’ are actually syntactically incorrect. it happens when we paste code from websites.

note: always try to write the code on your own. never copy paste the code, wrong practice.

thanks

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.