137k views
17 votes
Read three integers from user input without a prompt. Then, print the product of those integers. Ex: If input is 2 3 5, output is 30. Note: Our system will run your program several times, automatically providing different input values each time, to ensure your program works for any input values. See How to Use zyBooks for info on how our automated program grader works.

2 Answers

8 votes

Answer:

Step-by-step explanation:

The following code is written in Java and simply grabs the three inputs and saves them into three separate variables. Then it multiplies those variables together and saves the product in a variable called product. Finally, printing out the value of product to the screen.

import java.util.Scanner;

public class Main{

public static void main(String[] args){

Scanner in = new Scanner(System.in);

int num1 = in.nextInt();

int num2 = in.nextInt();

int num3 = in.nextInt();

int product = num1 * num2 * num3;

System.out.println(product);

}

}

User Nikita Mendelbaum
by
4.3k points
2 votes

Answer: Python

Step-by-step explanation:

num1 = int(input())

num2 = int(input())

num3 = int(input())

product = num1 * num2 * num3

print(product)

User Sunil Sunny
by
4.3k points