Can anybody please help me out in solving these problems in C++
Please reply to this thread ASAP!
Thnx and regards
Q.1. Write a program that accepts a nonnegative integer n and base b and display the digits of base-b representation (in reverse order) for each integer using a do-while loop. You may assume that each base is in the range 2 through 16. Use switch statement to display the symbols A, B, C, D, E, and F for 10, 11, 12, 13, 14 and 15 respectively for all the bases above 10. The program must be executed repeatedly for different integers and bases as long as the user wants.
Q.2. The proper divisors of an integer n are the positive divisors less than n. a positive integer is said to be deficient, perfect, or abundant number if the sum of its proper divisors is less than, equal to, or greater than the number, respectively. For example, 8 is deficient because its proper divisors are 1, 2, and 4, and 1 + 2 + 4 < 8; 6 is perfect because its proper divisors are 1, 2, and 3, and 1 + 2 + 3 = 6; 12 is abundant because its proper divisors are 1, 2, 3, 4, and 6, and 1 + 2 + 3 + 4 + 6 > 12. Write a program that takes an integer n and classifies each integer between n and n + 20 as being deficient, perfect or abundant