Page 321 - C++
P. 321

SECTION A
                        [Only for candidates, who opted for C++]




      1.   (a)     Write the type of C++ tokens (keywords and user defined identifiers)
                   from the following :                                                            2

                   (i)     else

                   (ii)    Long

                   (iii)   4Queue

                   (iv)    _count





           (b)     The following C++ code during compilation reports errors as follows :


                   Error: ‘ofstream’ not declared
                   Error: ‘strupr’ not declared

                   Error: ‘strcat’ not declared
                   Error: ‘FIN’ not declared


                   Write the names of the correct header files, which must be included
                   to compile the code successfully :                                              1



                   void main()
                   {
                      ofstream FIN("WISH.TXT");
                       char TEXT2[]="good day";
                       char TEXT1[]="John!";

                       strupr(TEXT2);
                       strcat(TEXT1, TEXT2);
                       FIN<<TEXT1<<endl;
                   }



      91                                             2
   316   317   318   319   320   321   322   323   324   325   326