Question: Could some explain in detail what this code does? #include Kiostream> using namespace std; string sum(string num1, string num2) int overage -0, sum; //convert to
#include Kiostream> using namespace std; string sum(string num1, string num2) int overage -0, sum; //convert to string string min num1, max num2, total //if the length of num is greater than num2 length then set max to num1 and min to num //else do opposite if (num1, length() num2. length max num1. min num2 else max num2 min num1. int i for (i min. length ()-1; i i--)f sum min[i] max[i max. length min length overage 2* '0 overage sum/10; sum 10; //convert the total to a char
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
