Question: What are the final values in the vals array after the following code is executed? int vals[] (-5, 2, 4, -1); int sum -
What are the final values in the vals array after the following code is executed? int vals[] (-5, 2, 4, -1); int sum - 0; for (int i = 0; i < 4; i++) { if (vals[i] < 0) sum else sum sum + (-vals[i]); sum + vals[i]; vals[i] sum;
Step by Step Solution
There are 3 Steps involved in it
The image contains a piece of C code which defines an array vals with four integers and a variable s... View full answer
Get step-by-step solutions from verified subject matter experts
