Page 53 - C++
P. 53

Class XII
                                                  Computer Science (083)
                                              Sample Question Paper 2018-19

             Time allowed: 3 Hours                                                                   Max. Marks: 70

                 General Instructions:

                  (a)   All questions are compulsory.

                  (b)  Programming Language with C++
                  (c)  In Question 2(b, d) ,3 and 4  has  internal choices.


             Q. No.  Part  Question Description                                                          Marks

             1        (a)    Write the type of C++ Operators (Arithmetic, Logical, and  Relational         (2)
                             Operators) from thefollowing:
                                 (i)    !(ii) !=(iii) &&(iv) %

                      (b)    Observe the following program very carefully and write the name of those      (1)
                             header file(s), which are essentially needed to compile and execute
                             thefollowing program successfully:
                                    void main()
                                    {
                                            char text[20], newText[20];
                                            gets(text);
                                            strcpy(newText,text);
                                            for(int i=0;i<strlen(text);i++)
                                                   if(text[i] = =’A’)
                                                          text[i] = text[i]+2;
                                            puts(text);
                                         }

                      (c)    Rewrite the following C++ code after removing any/all Syntactical Error(s)    (2)
                             with each correction underlined.

                             Note: Assume all required header files are already being included in the
                             program.

                             #define float PI 3.14
                             void main( )
                             {
                                    float  R=4.5,H=1.5;
                                    A=2*PI*R*H + 2*PIpow(R,2);
                                    cout<<‘Area=’<<A<<endl;
                             }




                                                              1
   48   49   50   51   52   53   54   55   56   57   58