array_task
array_task
Array Task
1. Write a C program to declare an array of integers and initialize it with values from 1 to 10. Print all the
elements of the array.
2. Write a program to find the largest and smallest elements in an array.
3. Create a C program to calculate the sum and average of all elements in an array.
4. Create a program to check whether a given number is present in an array.
5. Write a program to count the total number of even and odd numbers in an array.
6. Write a program to declare a 2D array of size 3x3 and initialize it with values. Print the array elements in
matrix form.
8. Write a program to count how many elements in a 1D array are positive, negative, and zero.
10. Write a program to find the sum of the diagonal elements of a 2D array. (3*3)