Why it is showing TLE?

@cbcao263

you need to divide carno by 10 in each iteration. Then your code will work.

Hope it Helps.

Sir, Now I have done that but even now it is showing TLE. What to do now?

No it was working fine. Send the link of your edited code here.

It is showing error when I submit it in my challenges. It shows timelimit.

You need to divide carno by 10 in each iteration of the while loop and not in the test case loop.

while(carno>0)
{
int ld=carno%10;
if(ld%2==0)
{
esum=esum+ld;
}
else
{
osum=osum+ld;
}
carno/=10;
}

@cbcao263
Please mark your doubt as resolved.

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.