(20%) Problem 4 Create a program that implements that alternates adding and subtracting numbers in a 2D array, starting
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
(20%) Problem 4 Create a program that implements that alternates adding and subtracting numbers in a 2D array, starting
Enter 16 numbers: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Output: 1 + 2 - 3 + 4 - 5 + 6 - 7 + 8 - 9 + 10 - 11 + 12 - 13 + 14 - 15 + 16 = 10
Enter 16 numbers: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 aInvalid input detected.
Enter 16 numbers: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 a
Invalid input detected.
(20%) Problem 4 Create a program that implements that alternates adding and subtracting numbers in a 2D array, starting with addition. The program should accept 16 values that are placed in a 4 x 4 array. Requirements • Create a 2D int array of size 4 x 4. . Read all integers from a user. • If an invalid input is given, warn the user and exit the program gracefully (do not use exit()). • Show the full equation and result.