Write a program to find product of numbers from 20 to 60 computer
Answers
Answered by
1
Explanation:
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
Answered by
4
Answer:
import java.io.*;
class Product
{
public static void main()
{
int I;
long p=1;
for (I=20;I<=60;I++)
p=p*I;
System.out.println(I);
}
}
Similar questions
Math,
2 months ago
Chemistry,
2 months ago
Math,
4 months ago
Math,
4 months ago
Political Science,
10 months ago
Psychology,
10 months ago