A directory of Objective Type Questions covering all the Computer Science subjects. Here you can access and discuss Multiple choice questions and answers for various compitative exams and interviews.

1. Which operator is having right to left associativity in the following?
a. Array subscripting
b. Function call
c. Addition and subtraction
d. Type cast
View Answer Report Discuss Too Difficult!
Answer: (d).Type cast

2. Which operator is having the highest precedence?
a. postfix
b. unary
c. shift
d. equality
View Answer Report Discuss Too Difficult!
Answer: (a).postfix

3. What is this operator called ?: ?
a. conditional
b. relational
c. casting operator
d. none of the mentioned
View Answer Report Discuss Too Difficult!
Answer: (a).conditional

4. What is the output of this program?
    #include <iostream>
    using namespace std;
    int main()
    {
        int a;
        a = 5 + 3 * 5;
        cout << a;
        return 0;
    }
a. 35
b. 20
c. 25
d. 30
View Answer Report Discuss Too Difficult!
Answer: (b).20

5. What is the use of dynamic_cast operator?
a. it converts virtual base class to derived class
b. it converts virtual base object to derived objeccts
c. it will convert the operator based on precedence
d. none of the mentioned
View Answer Report Discuss Too Difficult!
Answer: (a).it converts virtual base class to derived class

6. What is the output of this program?
    #include <iostream>
    using namespace std;
    int main()
    {
        int a = 5, b = 6, c, d;
        c = a, b;
        d = (a, b);
        cout << c << ' ' << d;
        return 0;
    }
a. 5 6
b. 6 5
c. 6 7
d. none of the mentioned
View Answer Report Discuss Too Difficult!
Answer: (a).5 6

7. What is the output of this program?
    #include <iostream>
    using namespace std;
    int main()
    {
        int i, j;
        j = 10;
        i = (j++, j + 100, 999 + j);
        cout << i;
        return 0;
    }
a. 1000
b. 11
c. 1010
d. 1001
View Answer Report Discuss Too Difficult!
Answer: (c).1010

8. What is the output of this program?
    #include <iostream>
    using namespace std;
    int main ()
    {
        int x, y;
        x = 5;
        y = ++x * ++x;
        cout << x << y;
        x = 5;
        y = x++ * ++x;
        cout << x << y;
        return 0;
    }
a. 749736
b. 736749
c. 367497
d. none of the mentioned
View Answer Report Discuss Too Difficult!
Answer: (a).749736

9. What is the output of this program?
    #include <iostream>
    using namespace std;
    int main()
    {
        int a = 5, b = 6, c;
        c = (a > b) ? a : b;
        cout << c;
        return 0;
    }
a. 6
b. 5
c. 4
d. 7
View Answer Report Discuss Too Difficult!
Answer: (a).6

10. What is the output of this program?
    #include <iostream>
    using namespace std;
    main()
    {
        double a = 21.09399;
        float b = 10.20;
        int c ,d;
        c = (int) a;
        d = (int) b;
        cout << c <<' '<< d;
        return 0;
    }
a. 20 10
b. 10 21
c. 21 10
d. none of the mentioned
View Answer Report Discuss Too Difficult!
Answer: (c).21 10

Page 1 of 30