數條c++問題,請高手解答
1.The following code multiplies an unsigned integer a by 9.
((a << 3) + a)
2.The following expression is always true, assuming a is an integer that has beenpreviously dened and initialized to 0.
(a = 3 - 4)
3.The following expression is always true (note that the operator < is left asso-ciative).
(1/3 < 1/2 < 1)
4.The following code outputs the number 5.
if(2 < 3) if(3 < 2); else cout << 5;
5.The following statements will give a compilation error.
int a = 0;
const int FACTOR = a++;
(對或錯?),(請加解釋)
6.Consider the following code:
int a = 1, b = 10;
int c = (a++) - (++b);
int d = (a++) + (++c);
b = ++d;
What are the values of the following variables after executing the above code?(請列出步驟及解釋)
a = 3
b =