Homework Assignment #1
Due by 11:59PM, Tuesday July 3rd, 2001

Write a C++ program that prompts the user to enter a 4-digit integer.Your program should print each of the four digits and the sum of the 4 digits. Finally, your program must print out which numbers from 2 through 9 evenly divide into the original 4-digit integer.

 SAMPLE EXECUTION #1 If the user enters the integer 5652, your program’s output should look like the following:The first digit is 5 The second digit is 6 The third digit is 5 The fourth digit is 2 The sum of the digits is 18 5652 is divisible by 2 5652 is divisible by 3 5652 is divisible by 4 5652 is divisible by 6 5652 is divisible by 9 SAMPLE EXECUTION #2 If the user enters the integer 15, your program’s output should look like the following:The first digit is 0 The second digit is 0 The third digit is 1 The fourth digit is 5 The sum of the digits is 6 15 is divisible by 3 15 is divisible by 5

HINTS

• Your program should only use the +, / and % arithmetic operators for integer calculations. DO NOT USE SUBTRACTION IN YOUR PROGRAM.
• You’ll need to create a variable to hold the original 4-digit integer and variables for each of the 4 digits. Your own style of programming will determine how many additional variables you will need for the program.