Go back

Data Structures and Algorithms Practical 1 - Array related problems

Problems given in class

  1. Print all the elements in an array.
  2. Print the first and last elements of an array.
  3. Print the middle element of the array.
  4. Print the double of all elements of an array.
  5. Find the negative element in an array.
  6. Print all the elements in odd position in array.
  7. Print all the elements in even position in array.
  8. Print the array in reverse.
  9. Find the sum and product of all the elements of a given array.
  10. Print the smallest and largest element of an array.

Bonus Add all of these options to a switch case.