You are on page 1of 5

ARRAYS

Practice question
1. Write a program to take 5 values from the user, store them in
an array and print the elements stored in the array.

2. Write a program to find largest and smallest elements in an


array.

3. Write a program to find largest and second largest elements


in array.

4. Write a program to find second largest and smallest


elements of an array.

5. Write a program to find maximum difference between two


elements in an array.
6. Write a program to insert an element in the sorted array.

7. Write a program to insert an element in an array.

8. Write a program to delete an element from an array.

9. Write a program to remove duplicate elements from an


array.

10. Write a program to reverse an array.

11. Write a program to separate odd and even numbers


from an array.

12. Write a program to cyclically permute the elements of


an array.
13. Write a program to find the number of elements in an
array.

14. Write a program to print all non repeated elements in an


array.

15. Write a program to count the occurrences of each


keyword using array.

16. Write a program to find two odd occurring elements in an


array.
17. Write a program to split the array and add first part to the
end.

18. Write a program to segregate 0s and 1s in an array.


19. Write a program to increment all elements of an array by
one.

20. Write a program to find two odd occurring elements in an


array.

21. Write a program to find sum of array elements.

22. Write a program to sort an array in ascending order.

23. Write a program to sort an array in descending order.

24. Write a program to merge two sorted array elements

25. Write a program to generate Pascal triangle using arrays.

You might also like