[go: up one dir, main page]

0% found this document useful (0 votes)
3 views1 page

Array Fetching Questions

The document contains a series of questions related to operations on numeric and string arrays. It includes tasks such as printing elements, finding lengths and indices, removing duplicates, sorting, and creating new arrays based on specific criteria. The questions cover both numerical and string data types, providing a comprehensive exercise on array manipulation.

Uploaded by

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

Array Fetching Questions

The document contains a series of questions related to operations on numeric and string arrays. It includes tasks such as printing elements, finding lengths and indices, removing duplicates, sorting, and creating new arrays based on specific criteria. The questions cover both numerical and string data types, providing a comprehensive exercise on array manipulation.

Uploaded by

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

=== Numeric Array Questions ===

1. Print the first and last elements of the array [12, 31, 41, 6, 12, 6, 53].
2. What is the length of the array [12, 31, 41, 6, 12, 6, 53]?
3. Find the first index of the value 6 in the array [12, 31, 41, 6, 12, 6, 53].
4. Find the last index of the value 12 in the array [12, 31, 41, 6, 12, 6, 53].
5. Remove duplicate values from the array [12, 31, 41, 6, 12, 6, 53].
6. Sort the array [12, 31, 41, 6, 12, 6, 53] in ascending order.
7. Find the largest number in the array [12, 31, 41, 6, 12, 6, 53].
8. Find the smallest number in the array [12, 31, 41, 6, 12, 6, 53].
9. Calculate the sum of all elements in the array [12, 31, 41, 6, 12, 6, 53].
10. Create a new array containing only numbers greater than 20 from the array [12,
31, 41, 6, 12, 6, 53].

=== String Array Questions ===


1. Print the first and last elements of the array ["DEBESH", "RANJANA", "akash",
"raj", "ratna", "simran"].
2. What is the length of the array ["DEBESH", "RANJANA", "akash", "raj", "ratna",
"simran"]?
3. Find the index of 'raj' in the array ["DEBESH", "RANJANA", "akash", "raj",
"ratna", "simran"].
4. If 'raj' appeared twice, find the last index of 'raj' in the array ["DEBESH",
"RANJANA", "akash", "raj", "ratna", "simran"].
5. Create a new array with all names in lowercase from the array ["DEBESH",
"RANJANA", "akash", "raj", "ratna", "simran"].
6. Sort the array ["DEBESH", "RANJANA", "akash", "raj", "ratna", "simran"]
alphabetically.
7. Reverse the order of elements in the array ["DEBESH", "RANJANA", "akash", "raj",
"ratna", "simran"].
8. Create a new array containing only names starting with 'r' (case-insensitive)
from the array ["DEBESH", "RANJANA", "akash", "raj", "ratna", "simran"].
9. Find the longest name in the array ["DEBESH", "RANJANA", "akash", "raj",
"ratna", "simran"].
10. Join all names in the array ["DEBESH", "RANJANA", "akash", "raj", "ratna",
"simran"] into a single string separated by commas.

You might also like