1. Write a user defined function to search an element in a sorted
array of N elements using binary search. The function should return
the position of the element in the array if the search is successful
and –1 otherwise. Write a complete program in C++ to define
the function and invoke it from main.
2. Write a program that reads name, roll number, mark in 4 subjects
and total mark of at least 5 students in a Class. Sort the list
in the descending order of marks and display the list.
3. Write a program to merge two sorted arrays A and B of size
m, n (list A in ascending order, list B in descending order) into
a final sorted array C of size m+n.
4. Given two arrays of integers X and Y of sizes m and n respectively.
Write a function named merge () which will produce a third array
named Z, such that the following sequence is followed.
(i)All odd numbers of X from left to right are copied into Z from
left to right
(ii) All even numbers of X from left to right are copied into
Z from right to left
(iii) All odd numbers of Y from left to right are copied into
Z from left to right
(iv)All even numbers of Y from left to right are copied into Z
from right to left
X, Y, Z are passed as arguments to function merge ( ). Write a
complete program in C++ to define the function and invoke it from
5. A linear array of size 50 stores information: Name of the
country, Country’s Capital, and per capita income of the
country. Write a complete program in C++ to do the following –
* To read a country’s name and displays capital and per
* To read the name of the capital city and displays country’s
name and per capita income.
Display an Error message in case of incorrect input.