Skip to content

Sum Limit is a logical problem based on the sum of two given digits. If the sum of the two digits has the same number of digits as the first given digit, return the sum of the two. If the sum has More digits than the first given digit return the first given digit only.

Notifications You must be signed in to change notification settings

CoderCoding00/Sum_Limit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Sum Limit Instructions

Given 2 non-negative ints, a and b, print their sum,
so long as the sum has the same number of digits as a.
If the sum has more digits than a, just return a without b.

Provided 2 solutions and used Solution 1 becasue it is more efficient. Tested both solutions and they work. 

Example Test Out Put
• inputof(2,3) -> 5
• inputof(8,3) -> 8
• inputof(8,1) -> 9

Tested the code in the terminal using the commands 
g++ main.cpp 
./a.out 
to test against the a.out

Screen Shot of the Test Output

fileSum_Limit

About

Sum Limit is a logical problem based on the sum of two given digits. If the sum of the two digits has the same number of digits as the first given digit, return the sum of the two. If the sum has More digits than the first given digit return the first given digit only.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages