Given the code: long x; cout << "Enter a number greater than 10: "; cin >> X; Write a few lines of code to extract and print the product of all digits of A product is the multiplication of all digits (e.g. 345 would be 3*4*5 = 60). Note that x can be a number of any length. Example Output 1 Enter a number greater than 10: 22 4 Example Output 2 Enter a number greater than 10: 345 60

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 21PE
icon
Related questions
icon
Concept explainers
Question

C++

Given the code:
long x;
cout << "Enter a number greater than 10: ";
cin >> X;
Write a few lines of code to extract and print the product of all digits of x.
A product is the multiplication of all digits (e.g. 345 would be 3*4*5 = 60).
Note that x can be a number of any length.
Example Output 1
Enter a number greater than 10: 22
4
Example Output 2
Enter a number greater than 10: 345
60
Transcribed Image Text:Given the code: long x; cout << "Enter a number greater than 10: "; cin >> X; Write a few lines of code to extract and print the product of all digits of x. A product is the multiplication of all digits (e.g. 345 would be 3*4*5 = 60). Note that x can be a number of any length. Example Output 1 Enter a number greater than 10: 22 4 Example Output 2 Enter a number greater than 10: 345 60
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Control Structure
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning