CBSE Guess > Papers > Important Questions > Class XII > 2010 > Computer Science > Computer Science By Ravi Kiran CBSE CLASS XII 3.c) Write a user-defined function in C++ to find and display the sum of diagonal elements
from a 2D array MATRIX[6][6] containing integers.
Q.1. Suppose a 1D array AR containing integers is arranged in ascending order. Write a user
defined function in C++ to search for one integer from AR with the help of binary search
method, to show presence of the number in the array. The function should have three
parameters: (1) an array AR (2) the number to be searched and (3) the number of elements N in Q.2. An array A[10][20] is stored in the memory with each element requiring 4 bytes of storage. If the base address of the array in the memory is 400, determine the location of A[8] [13] when the array VAL is stored (i) Row major (ii) Column major. Solution: Children, Try this answer. Q.3. Write a user-defined function in C++ to find and display the multiplication of row
elements of two dimensional array A[4][6] containing integers.
Q.1. Suppose an array P containing float is arranged in ascending order. Write a user defined
function in C++ to search for one float from p with the help of binary search method. The
function should return an integer 0 to show absence of the number in the array. The function
should have the parameters as (1) an array P (2) the number DATA to be searched (3) number Q.2. An array T[15][10] is stored in the memory with each element requiring 2 bytes of storage. If the base address of T is 2000, determine the location of T[7][8] when the array VAL is stored (i) Row major (ii) Column major. Solution: Children, Try this as an assignment. Paper By Mr. Ravi Kiran |