Answer to Question #293537 in Java | JSP | JSF for Sap

Question #293537

Write a program that calculates and prints the product of FIVE integers.

1
Expert's answer
2022-02-03T08:38:31-0500
import java.util.Scanner;
class App {
    public static void main(String[] args) {
        Scanner keyBoard = new Scanner(System.in);
        System.out.print("Enter number 1: ");  
        int n1=keyBoard.nextInt();
        System.out.print("Enter number 2: ");  
        int n2=keyBoard.nextInt();
        System.out.print("Enter number 3: ");  
        int n3=keyBoard.nextInt();
        System.out.print("Enter number 4: ");  
        int n4=keyBoard.nextInt();
        System.out.print("Enter number 5: ");  
        int n5=keyBoard.nextInt();
        int product=n1*n2*n3*n4*n5;
        System.out.print("The product of FIVE integers: "+product);  
        keyBoard.close();
    }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS