i am just learning c++ programming language and stuck at some point will anyone help me out. the problem is i had google some stuff and came to know that if conditions can change the varaibles value for temporary basis. my code is below.
#include <iostream>
using namespace std;
int main()
{
    int a = 2;
    int b = a + 1;
    if ((a = 3) == b)
    {
        cout << a;
    }
    else
    {
        cout << a + 1;
    }
    return 0;
}
in the above code its printing the else block why not the if block the conditions must be true ?
 
    