Computer Science, asked by Rainbowgain, 4 months ago

Write a program to find product of numbers from 20 to 60 computer​

Answers

Answered by jaihind1234
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 Anisha5119
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