- Print out the index of the minimum element in the
array.
So, for example:
~/$ ./ex1a
4
34 12 8 29
minimum element is A[2] = 8.
Solution: TE7a.cpp
-
Print elements of the array, separated by commas.
So, for example:
~/$ ./ex1b
4
34 12 8 29
A = [34, 12, 8, 29]
Solution: TE7b.cpp
-
Create and print array of the "partial differences"
of consecutive elements in the array.
Here's an example of a sequence of four numbers along
with the sequence of partial differences (note that
there are only three elements in that sequence).
3 7 8 5
\_/ \_/ \_/
2 1 -3
A run of your program should look like this:
~/$ ./ex1c
4
14 16 8 29
2 -8 21
Solution: TE7c.cpp
-
Split positive and negative. I actually want you to
create two new arrays, one containing the positive
elements of A, and one containing the negative elements
of A. Zero's in A should be ignored.
These arrays should be exactly the right size (no
extra cells), and you program should print each array
out.
A run of your program should look like this:
~/$ ./ex1d
10
0 1 2 -3 4 -5 -6 7 8 9
negative: -3 -5 -6
positive: 1 2 4 7 8 9
Solution: TE7d.cpp