(Separating Digits in an Integer) Write a program that inputs one five-digit number, sep- arates the number into its individual digits and prints the digits separated from one another by three spaces each. [Hint: Use combinations of integer division and the remainder operation.] For exam- ple, if the user types in 42139, the program should print 4 1 3 9 2.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter5: Repetition Statements
Section5.3: Interactive While Loops
Problem 6E: (Conversion) a. Write a C++ program to convert meters to feet. The program should request the...
icon
Related questions
Question

I want it without using loops and for, While ,Thanks.

2.30
(Separating Digits in an Integer) Write a program that inputs one five-digit number, sep-
arates the number into its individual digits and prints the digits separated from one another by three
spaces each. [Hint: Use combinations of integer division and the remainder operation.] For exam-
ple, if the user types in 42139, the program should print
4
2 1 3 9
Transcribed Image Text:2.30 (Separating Digits in an Integer) Write a program that inputs one five-digit number, sep- arates the number into its individual digits and prints the digits separated from one another by three spaces each. [Hint: Use combinations of integer division and the remainder operation.] For exam- ple, if the user types in 42139, the program should print 4 2 1 3 9
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr