A solution to the challenge of representing any given number as ' basepower + remainder' in C++
Requirements:
-
Takes two inputs one is the base number and the second one is the number to be represented in basepower + remainder format. For example if the user enters 3 as base number and 36 as the number the output should be “36 = 33 + 9”.
-
The program should check the given number should be greater than the base number. If not it shout output an error msg.
-
It should also check the base number is greater than 1.
-
Bonus requirement: The program should check if the remainder is divisible by the base if so it should output remainder as base * (remainder/base). For example for base 3 and number 36 the program output should be “36 = 33 + (3 * 3)