0% found this document useful (0 votes)
10 views2 pages

Pseudocode Array Worksheet Set2

Uploaded by

ahsan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views2 pages

Pseudocode Array Worksheet Set2

Uploaded by

ahsan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Pseudocode Worksheet: Arrays – Set 2

(No Solutions)
Instructions:
Write pseudocode to solve each of the following problems. Assume all arrays are 1-
dimensional unless stated otherwise.

1. Input N integers and display the elements at even indices.

2. Find and print the sum of elements at odd positions in the array.

3. Count how many times the maximum value appears in the array.

4. Input 10 integers and print the difference between the maximum and minimum
values.

5. Rotate the array to the right by one position.

6. Count how many elements are divisible by 3 in an array.

7. Check if the array contains any duplicate values.

8. Replace all negative numbers in the array with zero.

9. Input an array and double each element's value.

10. Count how many elements are prime numbers.

11. Replace each element with the square of the element.

12. Check if the array is a palindrome.

13. Input 10 integers and print them in reverse order without changing the original
array.

14. Find the mode (most frequent element) of an array.

15. Input 10 numbers and remove all duplicates (display only once each value).

16. Input an array of 10 integers and sort them in descending order.

17. Split an array into two arrays: one for even and one for odd numbers.
18. Count and print the number of elements that are multiples of both 2 and 5.

19. Find the sum of the first half and the second half of the array separately.

20. Find the product of all non-zero elements in an array.

You might also like