Page 42 - Modular_V2.0_C++_Flikpbook
P. 42

4.  Decrement operator is used to decrease the value of a variable by 1.           ……………………

                       5.  Explicit typecasting is done automatically by the C++ compiler.                ……………………

                  C.   Fill in the blanks using the words given below:



                                                   ==, AND, Modulus, Increment, Assignment


                       1.  The ……………………….. operator returns the remainder.


                       2.  The ……………………….. operator is used to check whether the values of two operands are equal.
                       3.  The ……………………….. operator returns true, if both operands are true.


                       4.  The ……………………….. operator assigns the value of the right operand to the left operand.

                       5.  The ……………………….. is the unary operator.

                  D.   Short answer type questions.
                       1.  What is the difference between '/' and '%' operators?
                       2.  What is operator precedence?

                       3.  What is type casting?
                       4.  What are relational operators?

                       5.  What are binary operators?

                  E.   Long answer type questions.
                       1.  Write the names of all the relational operators of C++?
                       2.  What is the difference between prefix and postfix increment? Give examples for both.

                       3.  Differentiate between implicit and explicit type casting.
                       4.  What is the difference between *= and /= operators?

                  F.   Find the output of the following codes:
                       1.  void main()                                    2.   void main()

                           {                                                   {

                               int x = 5, y = 0;                                 int a;
                               x++;                                              a = 34 / 4 - 4;

                               ++x;                                              cout<<a;

                               y = x++ + 1;                                    }
                               cout<< x;

                               cout<< y;
                           }




                   40
                          Touchpad MODULAR (Ver. 2.0)
   37   38   39   40   41   42   43   44   45   46   47