wap to accept a number from the user and calculate the product of prime digit
Answers
Answered by
0
Explanation:
Logic to find product of digits of a number
Extract last digit of the given number.
Multiply the extracted last digit with product.
Remove the last digit by dividing number by 10.
Answered by
1
Answer: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
Explanation:
Similar questions