wap a program in Java to ask the user to enter 10no and the print the product of the digit of the number
Answers
Answered by
0
Given a number, the task is to find the product of the digits of a number.
Examples:
Input: n = 4513
Output: 60
Input: n = 5249
Output: 360
Recommended: Please try your approach on {IDE} first, before moving on to the solution.
General Algorithm for product of digits in a given number:
Get the number
Declare a variable to store the product and set it to 1
Repeat the next two steps till the number is not 0
Get the rightmost digit of the number with help of remainder ‘%’ operator by dividing it with 10 and multiply it with product.
Divide the number by 10 with help of ‘/’ operator
Print or return the product
Below is the solution to get the product of the digits:
filter_none ok
Answered by
0
Answer:
12345689)456345544&&&&&3'&_-+&&+₹2₹&&
Similar questions
Computer Science,
4 months ago
Science,
4 months ago
Business Studies,
4 months ago
Math,
9 months ago
Geography,
9 months ago
Biology,
1 year ago