Actually the sum value in class AddNum is 6 but when the value is returned to Ans[i] in class IndividSum,it is showing 15.My question is why is it returning wrong value?
Type: Posts; User: spidey
Actually the sum value in class AddNum is 6 but when the value is returned to Ans[i] in class IndividSum,it is showing 15.My question is why is it returning wrong value?
Iam trying to solve a question.The question is .
Example
Input : 12345
Output: 6
The individual digits should be added untill it become single digit.1+2+3+4+5=15 -->1+5=6.
In the below code...