Ask Question
21 March, 06:33

What will the following program display?

#include using namespace std; int main () { int a = 0, b = 2, x = 4, y = 0;

a. cout << (a = = b) << " ";

b. cout << (a! = b) << " ";

c. cout << (b <=x) << " ";

d, cout < a) << endl; return 0; }

+1
Answers (1)
  1. 21 March, 08:50
    0
    0 1 1 0

    Explanation:

    Running the below code

    #include

    using namespace std;

    int main () {

    int a = 0, b = 2, x = 4, y = 0;

    cout << (a = = b) << " ";

    cout << (a! = b) << " ";

    cout << (b <=x) << " ";

    cout < a) << endl;

    return 0;

    }

    line 5 = states is a = = b, i. e 0 = = 2, which returns false 0

    line 6 = states is a! = b i. e 0 not equal to 2 returns true 1

    line 7 = states is b < = x i. e 2 less than or equal to 4 returns true 1

    line 8 = states is y >a i. e 0 > 0 returns false 0
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “What will the following program display? #include using namespace std; int main () { int a = 0, b = 2, x = 4, y = 0; a. cout ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers