(Digits of an Integer) Write a program that inputs a five-digit integer, separates the integer into its individual digits and prints the digits separated from one another by three spaces each. [Hint: Use the integer division and modulus operators.] For example, if the user types in 42339, the pro- gram should print:
4 2 3 3 9
What will be an ideal response?
```
#include
using namespace std; // program uses names from the std namespace
int main()
{
int number; // integer read from user
cout << "Enter a five-digit integer: "; // prompt
cin >> number; // read integer from user
cout << number / 10000 << " ";
number = number % 10000;
cout << number / 1000 << " ";
number = number % 1000;
cout << number / 100 << " ";
number = number % 100;
cout << number / 10 << " ";
number = number % 10;
cout << number << endl;
} // end main
```
You might also like to view...
Discuss the importance of planning in the database lifecycle, detailing the significant stages in the process. Once the design phase of the database lifecycle has been initiated, the objective is to achieve a conceptual database schema design. Explain the procedures necessary in order to achieve this objective.
What will be an ideal response?
Can the wires of a ring network be arranged in a straight line (e.g., down a hallway)? Explain.
What will be an ideal response?
A deletion anomaly forces you to delete one piece of data when you wanted to delete two pieces of data
Indicate whether the statement is true or false
What is the purpose of the grid overlays offered in the tool options pane when you
select the Crop tool? What will be an ideal response?