Sorry to bother you again but can plz help me understand ehy im getting WA for Problem 1(Problem code: CMB01) of peer section. Link to my submission: CodeChef: Practical coding for everyone Thank you in advance again.
Well,you are getting WA because your code for reversing the number is not actually reversing the number.after the execution of for loop the right most digit of the number is used in addition.i.e
if the number is 12345,then in each iteration you are updating a1 as mod of number/10,i.e
iteration no.1 : a1=12345%10=5
iteration no.2 :a1=1234%10=4
iteration no.3 : a1=123%10=3
iteration no.4 : a1=12%10=2
iteration no.5 : a1=1%10=1
thus your reversing code is outputting the right most digit of number.Rather than writing
This will give you the reversed number.Do check it out.Do the same editing for other ‘for’ loops too.
its still not working!!
Link: CodeChef: Practical coding for everyone
Hey,why are you printing the reversed nos. i.e a and b,that is not asked.You have to give the output as asked in the question,just remove those printf’s for integers separately,n only print the final sum.This should get you AC.Try it.
Not working! Link: CodeChef: Practical coding for everyone
O sorry i had mistakenly deletedthe \n so it wasnt working now ive got it thank you very much:)