Nettetb will get evaluated as:-a++ (post increment), so its 10 (initially), then it becomes 11. 11 is received by ++a, so it pre increments it and becomes 12. so b=10+12=22. Now, printf() … NettetFrom first term of the expression b=a++ + ++a; a++ means 10 but it will increase it value if it is use again. ++a means increase value of a immediately. What is value of a. It is 10, …
前置++a 和 后置a++_八戒吃菜的博客-CSDN博客
NettetC Language Interview preparation Tests have the best questions to make you understand the concepts and prepare for interviews. Nettetits all about increment operator. as in java ++ means +1 and its before a so +1 before a in the initial value n at every step value changes and at last stored in b so as a =5 b= 1+a … rv wheels and deals
int a=1,b;b=a++;求a和b--CSDN问答
Nettet23. feb. 2011 · a++ is postfix increment and ++a is prefix increment. They do not differ when used in a standalone statement, however their evaluation result differs: a++ returns the value of a before incrementing, while ++a after. I.e. int a = 1; int b = a++; // result: b == 1, a == 2 int c = ++a; // result: c == 3, a == 3 Share Improve this answer Follow Nettet#include int main() { int a = 5, b = 0; printf("\n%d", a && b); printf("\n%d", a b); printf("\n%d", !a); printf("\n%d", !b); return 0; } Output Since a is non-zero but b is zero, so AND between them will be false (or 0). As only one of them is true (or non-zero). Nettet23. aug. 2024 · Explanation: ++a +b = 6 + Garbage floating point number = Garbage floating point number // From the rule of automatic type conversion. Hence sizeof operator will return 4 because size of float data type in c is 4 byte. Value of any variable doesn’t modify inside sizeof operator. Hence value of variable a will remain 5. rv wheelchair