Page 159 - C++
P. 159
1 2 0
1 0 0
OR
(b) Write a function in C++ which accepts an integer array and its size as arguments and exchanges the values
of first half side elements with the second half side elements of the array. (3)
Example :
If an array of 8 elements initial content as 2, 4, 1, 6, 7, 9, 23, 10. The function should rearrange array as 7, 9,
23, 10, 2, 4, 1, 6
(c) An array S[10] [30] is stored in the memory along the column with each of its element occupying 2 bytes.
Find out the memory location of S[5][10], if element S[2][15] is stored at the location 8200. (3)
OR
(c )An array MAT[30][10] is stored in the memory along column wise with each element occupying 8 bytes of
the memory. Find out the Base address and the address of element MAT[20][5] , if the location MAT[3][7] is
stored at the address 1000. (3)
(d) Write a function in C++ to perform insert operation in a static circular queue containing information about
books (represented with the help of an array of structure BOOK). (4)
struct BOOK
{
long AccNo; //Book account number
char Title[20]; //Book Title
};
OR
(d) Write the definition of a member function Pop( ) in C++, to delete a book from a dynamic stack of
TEXTBOOKS considering the following code is already included in the program. (4)
struct TEXTBOOKS
{
char ISBN[20];
char TITLE[80];
TEXTBOOKS *Link;
};
class STACK