Computer Science, asked by rohitadey33, 9 months ago

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 devrajsharma299
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 irfanriyaz27
0

Answer:

12345689)456345544&&&&&3'&_-+&&+₹2₹&&

Similar questions