Operators Interview Questions

    Question 1: C++ Arithmetic Operators

    Which of the following is NOT an arithmetic operator in C++?

    Question 2: C++ Guess the Output – Modulus Operator

    What will be the output of the following C++ code snippet?

    #include <iostream> using namespace std; int main() { int x = 10, y = 3; cout << x % y; return 0; }

    Question 3: C++ Relational Operators

    Which operator is used to check if two values are not equal in C++?

    Question 4: C++ Guess the Output – Pre vs Post Increment

    What will be the output of the following C++ code snippet?

    #include <iostream> using namespace std; int main() { int a = 5; cout << a++ << " " << ++a; return 0; }

    Question 5: C++ Logical Operators

    Which of the following is the correct logical AND operator in C++?

    Question 6: C++ Guess the Output – Logical NOT

    What will be the output of the following C++ code snippet?

    #include <iostream> using namespace std; int main() { bool x = true; cout << !x; return 0; }

    Question 7: C++ Assignment Operators

    Which of the following is the compound assignment operator in C++?

    Question 8: C++ Guess the Output – Bitwise Operator

    What will be the output of the following C++ code snippet?

    #include <iostream> using namespace std; int main() { int x = 6, y = 3; cout << (x & y); return 0; }

    Question 9: C++ Ternary Operator

    Which of the following is the correct syntax of the ternary operator in C++?

    Question 10: C++ Guess the Output – Mixed Operators

    What will be the output of the following C++ code snippet?

    #include <iostream> using namespace std; int main() { int a = 10, b = 4, c = 3; cout << a - b * c; return 0; }