Ask Question
1 August, 14:40

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. 1 August, 16:14
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers