Page 52 - Modular_V1.1_Flipbook
P. 52

Periodic Assessment-2

                                                      (Based on chapters 3 to 5)



                  A.   Write the use of following operators with an example:
                       1.  != operator
                           ...............................................................................................................................................................................................

                           ...............................................................................................................................................................................................
                       2.  && operator

                           ...............................................................................................................................................................................................
                           ...............................................................................................................................................................................................
                       3.  %= operator

                           ...............................................................................................................................................................................................
                           ...............................................................................................................................................................................................
                       4.  ++ operator

                           ...............................................................................................................................................................................................
                           ...............................................................................................................................................................................................

                  B.   Write the output of the following program:
                           #include <iostream.h>
                           void main() {
                             int time = 20;
                             if (time < 18) {
                                   cout << “Good day.”;
                             } else {
                                   cout << “Good evening.”;
                             }
                           }

                  C.   Write a C++ program to solve the following expression:
                           A + 3 * (B - 4) - 10/2

                           Where, A = 25 and B = 10.





















                  50      Touchpad MODULAR (Version 1.1)-X
   47   48   49   50   51   52   53   54   55   56   57