CPP

CPP

Operators has 8 Questions

Which operator is having right to left associativity in the following?

Array subscripting
Function call
Addition and subtraction
Type cast
Which operator is having the highest precedence?

postfix
unary
shift
equality
What is this operator called ?: ?

conditional
relational
casting operator
none of the mentioned
What is the output of this program?
  1.     #include 
  2.     using namespace std;
  3.     int main()
  4.     {
  5.         int a;
  6.         a = 5 + 3 * 5;
  7.         cout << a;
  8.         return 0;
  9.     }

35
20
25
30
What is the use of dynamic_cast operator?

it converts virtual base class to derived class
it converts virtual base object to derived objeccts
it will convert the operator based on precedence
None of the mentioned
What is the output of this program?
  1.     #include 
  2.     using namespace std;
  3.     int main()
  4.     {
  5.         int i, j;
  6.         j = 10;
  7.         i = (j++, j + 100, 999 + j);
  8.         cout << i;
  9.         return 0;
  10.     }

1000
11
1010
1001
What is the output of this program?
  1.     #include 
  2.     using namespace std;
  3.     int main ()
  4.     {
  5.         int x, y;
  6.         x = 5;
  7.         y = ++x * ++x;
  8.         cout << x << y;
  9.         x = 5;
  10.         y = x++ * ++x;
  11.         cout << x << y;
  12.         return 0;
  13.     }

749736
736749
367497
none of the mentioned
What is the output of this program?
  1.     #include 
  2.     using namespace std;
  3.     main()
  4.     {
  5.         double a = 21.09399;
  6.         float b = 10.20;
  7.         int c ,d;
  8.         c = (int) a;
  9.         d = (int) b;
  10.         cout << c <<' '<< d;
  11.         return 0;
  12.     }

20 10
10 21
21 10
none of the mentioned