Last Updated : 10 Apr, 2024

What will be the output of the program in C++

#include <iostream>
using namespace std;

int main()
{
    int a = 0;
    int b = 10;
     if (a && b)
      {
         cout << \"True\"<< endl ;
      }
    else
     {
        cout << \"False\"<< endl ;
     }
        return 0;
}

(A) True
(B) False
(C) Error
(D) None of the mentioned


Answer: (B)

Explanation: && is called as Logical AND operator, if there is no zero in the operand means, it will be true otherwise false.


Share your thoughts in the comments