Question: Use scnr . nextInt ( ) to read integers from input into inputData until 1 0 0 is read. For each remaining integer read before
Use scnrnextInt to read integers from input into inputData until is read. For each remaining integer read before if the
integer is positive, output the integer followed by a newline and multiply partialProduct by the integer.
Ex: If the input is then the output is:
The product of all positive integers is
Note: The sentinel value is
import java.util.scanner;
public class Partialproduct
public static void mainstring args
Scanner scnr new Scanner
System.in;
int inputData;
int partialproduct;
partialproduct ;
Your code goes here
System.out.printlnThe product of all positive integers is partialproduct;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
