Page 158 - C++
P. 158

IName string data type

        Member functions:

        Constructor of class Institute

        Function IEntry() to input values of data members

        Function IDisplay() to display values

        };

        Q3.  (a) Write a user-defined function AddEnd4(int A[][4],int R, int C) in C++ to find and display the sum of all
        the values, which are divisible by 4.                                                                (2)

        For example if the content of array is:

        24 16 14 19 5 4

        The output should be 44
                                                             OR


        (a) Write code for a function void ChangOver(intP[],intN) in C++, which re-positions all the elements of the
            array by shifting each of them to the next position and by shifting the last element to the first position.(2)















        (b) Write function in C++ which accepts an integer array and size as arguments and assign values into a 2D
            array of integers in the following format :                                                      (3)
          If the array is 1, 2, 3, 4, 5, 6.
         The resultant 2D array is given below

        1    2    3    4    5    6

        1    2    3    4    5    0

        1    2    3    4    0    0

        1    2    3    0    0    0

        1    2    0    0    0    0

        1    0    0    0    0    0

        If the array is 1, 2, 3.The resultant 2D array is given:

        1    2    3
   153   154   155   156   157   158   159   160   161   162   163