Page 345 - C++
P. 345

CBSE AISSCE 2017-2018 Marking Scheme for Computer Science
                                       (2018-2019 Sub Code: 083       Paper Code: 91)

                           void main()
                           {
                              int A=20,B=4;
                              Revert(A,B);
                              cout<<A<<"&"<<B<<endl;
                              B--;
                              Revert(A,B);
                              cout<<A<<"#"<<B<<endl;
                              Revert(B);
                              cout<<A<<"#"<<B<<endl;
                           }

                    Ans  35&4
                           38#3
                           38#9

                           (½ Mark for writing each correct value)
                           OR
                           (Only ½ Mark for writing all ‘&’ and ‘#’ at proper places)
                           Note:
                              ●   Deduct only ½ Mark for not considering any or all correct
                                  placements of & and #
                              ●   Deduct only ½ Mark for not considering any or all line break

                    (e)    Find and write the output of the following C++ program code:                        2
                           Note​: Assume all required header files are already included in the program.

                           #define Modify(N) N*3+10
                           void main()
                           {
                               int LIST[]={10,15,12,17};
                               int *P=LIST, C;
                               for(C=3; C>=0; C--)
                                 LIST[I]=Modify(LIST[I]);
                               for (C=0; C<=3; C++)
                               {
                                   cout<<*P<<":";
                                   P++;
                               }
                           }

                    Ans    Considering ​LIST[I]​ being replaced with ​LIST[C]

                           40:55:46:61:

                           (½ Mark for writing each correct value)
                           Note:
                           ●  Deduct ½ Marks if the values are written in reverse order
                           ●  Full 2 marks for writing ​"​undeclared variable ​I"/"​Error​"​ / ​"​No
                              Output​"​. ​Ignore output if the error is mentioned.





                                                        Page #3/35
   340   341   342   343   344   345   346   347   348   349   350