C语言中的逻辑运算符

这个是书上的,没明白表达的是什么意思,求解答,就是这个思考题
变量a为5,b为10,求运算后b的值是多少
a大于2&&(b=5)

应该b=5吧!a>2&&b=5,a已经大于2了,只要b=5就行了吧

b 的值为 5,在 a > 2 && (b = 5); 这一句中,已经将 b 赋值为 5 了。

img

#include <iostream>
using namespace std;

int main()
{
    int a = 5;
    int b = 10;
    int c = a > 2 && (b = 5);
    cout << "a = " << a << endl;
    cout << "b = " << b << endl;
    cout << "c = " << c << endl;
    
    system("pause");
    return 0;
}