#include <iostream>usingnamespace std;
int main()
{
int x;
x = 99; // assignment: set x to 99
x == 99; // equality: true/false question (true)
x == 42; // equality: (false)if(x == 99) // if expression true, then
{ // execute body in braces
cout << "x is 99\n";
}
if(x == 42) // This expression is false
{ // so we skip this body in braces
cout << "x is 42\n";
}
if(x = 42) // ASSIGNMENT, changes x!
{ // (probably not what you meant)
cout << "x is 42 now!\n";
}
if(x = 0) // ASSIGNMENT, changes x!
{ // but also evaluates to RHS, which is false.
cout << "x is 0 now!\n";
}
// Multiple assignment:int y, z;
y = z = 42; // Assigns 42 to both variablesreturn0;
}