Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write C++ program to prompt user to enter a 3-digits number, say 371, to a variable called num. Then store each digit of this inputted
Write C++ program to prompt user to enter a 3-digits number, say 371, to a variable called num. Then store each digit of this inputted number to three different variables called digit1, digit2 and digit3. Hence, when number entered is 371, digit1 is 3, digit2 is 7 and digit3 is 1. Display the value of inputted number followed by digit1, digit2 and digit3. Hint: You have to use / and % operator in this question.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started