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

Array exercises

1) Write a program to count the number of elements in an array within a specified range.

2) Write a program to print how many negative numbers in an array.

3) Write a program to check whether an element given by the user exists in a given array.

4) Write a program that finds the location of the largest value in a 2D array of integers.

5) Write a program that finds the largest and smallest values in an array of integers.

6) Write a program that checks if an array of integers is sorted in ascending order.

7) Write a program using function to finds the second largest value in an array of integers.

8) Write a program that creates an array of integers, fills it with values, and then calculates the average of the values.

9) Write a program using function to calculate the sum of all the values in an array of integers.

10) Write a program that multiplies two 2D arrays of integers.

You might also like