A vector is given by: x=[15 -6 0 8 -2 5 4 -10 0.5 3]. Usingconditional statement
ID: 3616905 • Letter: A
Question
A vector is given by: x=[15 -6 0 8 -2 5 4 -10 0.5 3]. Usingconditional statements and loops, write a program that determinesand displays the sum of the positive elements of the vector, andthe sum of the negative elements of the vector.I know that I need to use for-end loops and if-elsestatements, but I can't figure out how to put it alltogether.
A vector is given by: x=[15 -6 0 8 -2 5 4 -10 0.5 3]. Usingconditional statements and loops, write a program that determinesand displays the sum of the positive elements of the vector, andthe sum of the negative elements of the vector.
I know that I need to use for-end loops and if-elsestatements, but I can't figure out how to put it alltogether.