Question: can you do the problem, without using the while function like an if else statment maybe instead? B) Write a program for Programming Exercise 2.6
B) Write a program for Programming Exercise 2.6 on p 65 in the textbook (find the sum of the digits in a positive integer with up to 3 digits). Hint: Use integer division and modulus. Testing: Run the program for the three cases shown below (the first case is the example provided with the problem in the text) Display the result in the format indicated in the textbook problem. Case Number 1 999 2 Any 1 digit number 3 Any 2 digit number 3 Any 3 digit number (except 999)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
