6.18 LAB: Sum of products Write a program that reads two lists of integers from input into two arrays and outputs the su
Posted: Fri Jul 08, 2022 6:16 am
6.18 LAB: Sum of products
Write a program that reads two lists of integers from input intotwo arrays and outputs the sum of multiplying the correspondinglist items. The program first reads an integer representing thelength of each list, followed by two lists of integers.
Ex: If the input is:
the program calculates (1 * 3) + (2 * 2) + (3 * 1) andoutputs
Ex: If the input is:
the program calculates (2 * 1) + (3 * 1) + (4 * 1) + (5 * 1) andoutputs
Write a program that reads two lists of integers from input intotwo arrays and outputs the sum of multiplying the correspondinglist items. The program first reads an integer representing thelength of each list, followed by two lists of integers.
Ex: If the input is:
the program calculates (1 * 3) + (2 * 2) + (3 * 1) andoutputs
Ex: If the input is:
the program calculates (2 * 1) + (3 * 1) + (4 * 1) + (5 * 1) andoutputs