C++ OPERATOR | C++ FOUNDATION Question 9

Last Updated :
Discuss
Comments

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

#include <iostream>
using namespace std;
int main() {
   int a = 0;
   int b = 10;
   a = 2;
   b = 7;
   if (a && b) {
       cout << "true: " << endl;
   }
   else 
   {
       cout << "false: " << endl;
   }
   return 0;
}

true

false

error

10

Share your thoughts in the comments