Question: Integer arrays arr 1 and arr 2 are read from input, each containing three elements. If an element in arr 1 is less than or
Integer arrays arr and arr are read from input, each containing three elements. If an element in arr is less than or equal to the corresponding element in arr then replace the element in arr with Otherwise, multiply the element in arr by
Ex: If the input is:
then the output is:
import java.util.Scanner;
public class ArrComparison
public static void mainString args
Scanner scnr new ScannerSystemin;
final int NUMVALS ;
int arr new intNUMVALS;
int arr new intNUMVALS;
int i;
for i ; i NUMVALS; i
arri scnrnextInt;
for i ; i NUMVALS; i
arri scnrnextInt;
Your code goes here
for i ; i arrlength; i
System.out.printarri;
System.out.println;
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
