If dd[0] and dd[1] contain the character they entered, the character is NOT the numeric value. (For example in ASCII '0' is 48)
So if the example is dd[0] = '2' and dd[1] = '3' then
aa = dd[0] + dd[1]; would give aa the value 50 + 51 or 101.
If you want the numeric value I usually do something like
(dd[0] - '0') which in our case would be 2.
So if we did that as we went, we could write
aa = (dd[0] - '0') + (dd[1] - '0')
There, now aa is 2 + 3 which makes aa 5. (wait, didn't you say it should be 23? maybe I missed something.)
I guess I could have done:
aa = 10 * (dd[0] - '0') + (dd[1] - '0')
That would be 23.
You could probably even do it without the array of characters (unless you needed them for something else):
aa = (getinp() - '0');
aa = 10 * aa + (getinp() - '0');