URI 1212 -- Primary Arithmetic

Problem Link

Problem Name : Primary Arithmetic 
Solution :

Assume that a=99 and b=9999 so how to count carry variable ?
let's see,

n1=a%10 got 9
n2=b%10 got 9 

sum=9+9=18 so carry=1

n1=a%10 got 9
n2=b%10 got 9 

sum=9+9=18 so carry= 1+1 (previous counted 1) and so on...

Another way if , sum is not equal or greater than 10 than carry=0.