Question: Language c++ thank you Write a program that read a four-digit number and print the sum of the digits. Expected output of the program is

Language c++ thank you

Language c++ thank you Write a program that read a four-digit number

Write a program that read a four-digit number and print the sum of the digits. Expected output of the program is as follows: Enter a number of four digits: 4567 Sum of digits is: 126 Hint-1: For example, input a number N= 3467, the output should be 32 +42 +62 + 72 = 110. Hint-2: Use % and operators. *You should test your program using PASS

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!