Saturday, June 13, 2015




Q 1:- a) Write a function in C++ which take an array, its size and number to be searched with in array, the function should determine how many time the number is repeated in array.
For example let an array A as follows
10
2
8
2
11
29
21
2
11
Find_times (A, 9, 2); should return 3,
Find_times (A, 9, 8); should return 1;
b) The intersection of two sets is the common elements presented in those sets for example
let A={1,9,5,4,8} and B={8,10,6,14} are two sets ,their intersection will be {1,4,8}
Write a program in c++ having two array A and B, both arrays represent sets;
Find and print the intersection of these arrays.
Q:-2 a) write a piece of code to find the two maximum values with in two dimensional array of integers.
b) A palindrome is an array which is read as same from front and back like 12321 ,tibit etc.
Write a program in C++ to find whether a given array is palindrome or not .
Q 3:- a) Write a code in c++ which to print following sequence N=7;
         
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
                            

b)   Write a function in c++ to find a digit sum of an integer (e.g let N=21934 digit sum of N=2+1+9+3+4=19.)