Sree Syamaprabha Tuition Centre
Plus One Computer Science
Chapter 8 :Array
1. Declare an array of size 5 and intitialize it with the numbers 8, 7, 2, 4 and 6
2. Predict the output of the following C++ program.
#include <iostream.h>
int main()
{
int array[] = {1, 2, 4, 6,7,5};
for (int n =1; n<=5; n++)
array [n] = array [n – 1 ];
for (n = 0; n <= 5; n++)
cout<< array [n];
return 0;
}
3. Write C++ program for sorting a list of numbers using Bubble Sort Method.
(2)
4. Write the different passes of sorting the following numbers using Bubble
Sort.
32, 21, 9, 17, 5
5. Explain different types of arrays.
6. Differentiate linear search and binary search
7. Differentiate bubble sort and selection sort
8. Write a program to perform matrix addition, multiplication, subtraction