Array
Array
1. Write a program to search for an integer value input by the user in the sorted list given
below using binary search technique. If found display ''Search Successful'' and print the
element, otherwise display ''Search Unsuccessful'' {31, 36, 45, 50, 60, 75, 86, 90}
2. Write a program to input 15 integer elements in an array and sort them in ascending order
using the bubble sort technique.
3. Write a program to accept name and total marks of N number of students in two single
subscript array name[] and totalmarks[ ].
Calculate and print:
(i) The average of the total marks obtained by N Number of students.
[average = (sum of total marks of all the students)/N]
(ii) Deviation of each student’s total marks with the average.
[deviation = total marks of a student – average]
4. Write a program to input integer elements into an array of size 20 and perform the
following operations:
(i) Display largest number from the array.
(ii) Display smallest number’from the array.
(iii) Display sum of all the elements of the array.
5. Write a program to initialize the seven Wonders of the World along with their locations
in two different arrays. Search for a name of the country input by the user. If found,
display the name of the country along with its Wonder, otherwise display “Sorry Not
Found!”.
6. Write a program to accept the names of 10 cities in a single dimension string array and
their STD (Subscribers Trunk Dialing) codes in another single
dimension integer array. Search for a name of a city input by the user in the list. If found,
display* “Search successful” and print the name of the city along with its STD code, or
else display the message “Search Unsuccessful, No such city in the list”.
1|Page
7. Write a program to input 10 integer elements in an array and sort them in descending
order using the bubble sort technique.
8. Write a program to input and store roll numbers, names and marks in 3 subjects of n
number students in five single dimensional array and display the remark based on
average marks as given below : (The maximum marks in the subject are 100)
9.
9. Write a program to accept the year of graduation from school as an integer value from,
the user. Using the Binary Search technique on the sorted array of integers given below.
Output the message “Record exists” If the value input is located in the array. If not,
output the message “Record does not exist”.
{1982, 1987, 1993, 1996. 1999, 2003, 2006, 2007, 2009, 20101.
10. Write a program to input and store the weight of ten people. Sort and display them in
descending order using the selection sort technique.
2|Page