Page 92 - C++
P. 92

MODEL TEST PAPER- I

                                                                                 CLASS XII

                                                 Computer Science (083)
        1. (a) What is the difference between Local Variable and Global Variable ? Also, give suitable C++ code to
        illustrate both.                                                                                     [2]

        (b) Write the names of the header files, which is/are essentially required to run/execute the following C++
        code:                                                                                                [1]

        void main ()

        {
        char C, String [] = “Excellence Overload”;


        for (int I=0; String [I] ! = ‘\0’;I++}
        if (String [I] == “ “)


        cout<<endl;
        else

        {

        C=toupper(String [I]);

        cout<<C;

        }

        }

        (c) Rewrite the following program after removing the syntactical errors. Underline each correction.    [2]

        #include [iostream.h]

        typedef char Text (80);

        void main ()

        {

        Text T=“Indian”;

        int Count=strlen(T);

        cout<<T<<”has”<<Count<<”characters”<<endl;

        }

        (d) Find the output of the following program:                                                        [3]

        # include <iostream.h>

        void ChangeArray (int Number, int ARR[], int Size)

        {

        for (int L=0; L<Size; L++)
   87   88   89   90   91   92   93   94   95   96   97