Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Exercises: function, vector, conditional and loop

 Write a function that define this vector and:

3 4 5 9 2 9 6 4 4 5

1. Show the element of the position 5


2. Show the elements of the position 3 and 7
3. If the number of the position 4 is greater than the position 8, the
program will exchange them
4. If there are number greater than 9, write in these positions the
number 10
5. Delete the element of the position 4
6. If there are numbers less than 5, write in these positions the
number -1 and show the vector to the user

1
Exercises: function, vector, conditional and loop
 Write a function that define this vector and:

3 4 5 9 2 9 6 4 4 5

7. Show the elements of the positions greater than 5


8. Show the elements greater than 5
9. Show the elements of the positions less than 5
10. Show the elements less than 5
11. Assign the value 8 to the position 6
12. Assign the value 4 to the position 3
13. Assign the value 2 and 8 to the position 1 and 10

You might also like