Skip to main content

Multidimensional Arrays

1

Array Traversal

Exercise

Exercise 1

  • Create an array that can hold nn integers
  • Fill up the array with user inputs
  • Ask the user to enter a value that they want to find
  • Show if the value is in the array
1

Exercise 2

  • Create an array that can hold nn integers
  • Fill up the array with user inputs
  • Ask the user to enter a value that they want to find
  • Show how many times the value appears in the array
2

Exercise 3

  • Create an array that can hold nn integers
  • Fill up the array with user inputs
  • Ask the user to enter a value that they want to find
  • Show whether the value is in the array or not
3

Exercise 4

  • Create an array that can hold nn integers
  • Fill up the array with user inputs
  • Ask the user to enter a value that they want to find
  • Show on which index the value appears in the array
4

Exercise 5

  • Create an array that can hold nn integers
  • Fill up the array with user inputs
  • Find the largest value in the array
  • Also display on which index the maximum value appears in the array
5

Exercise 6

  • Create a 2-dimensional array that can hold m x n integers
  • Fill up the array with user inputs
  • Display the contents of the array
6

Exercise 7

  • Create a 2-dimensional array that can hold m x n integers
  • Fill up the array with user inputs
  • Ask the user to enter a value that they want to find
  • Show how many times the value appears in the array
7

Exercise 8

  • Create a 2-dimensional array that can hold m x n integers
  • Fill up the array with user inputs
  • Find the largest value in the array
  • Also display on which index the maximum value appears in the array
8