Operators Interview Questions

    Question 1C++ Arithmetic Operators

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

    Question 2C++ 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 3C++ Relational Operators

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

    Question 4C++ 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 5C++ Logical Operators

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

    Question 6C++ 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 7C++ Assignment Operators

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

    Question 8C++ 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 9C++ Ternary Operator

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

    Question 10C++ 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; }