Hi,
I got some doubts...may i know what is mean by x&01?
and b++?
The short answers from are correct; these notes add practical context and common pitfalls.
A frequent use of the bit test in expressions like x & 1 is to check the low bit (parity) or to mask off lower bits. For portability and clarity prefer explicit unsigned arithmetic when manipulating raw bits, and always parenthesize when mixing with comparisons: (x & 1) == 1 rather than x & 1 == 1. For signed values, using x % 2 != 0 is often clearer about intent. Example patterns:
/* explicit bit test */
if ((unsigned)x & 1U) { /* odd */ }
/* clearer for signed ints */
if (x % 2 != 0) { /* odd */ } Postfix increment (b++) returns the old value and then increments, while prefix (++b) yields the new value. The bigger concern in real code is sequencing: modifying and accessing the same scalar multiple times in one expression (for example i = i++ or a[i] = i++) is undefined in C. Keep increments in separate statements or use temporaries to avoid undefined or compiler-dependent results. In loops, prefer simple, obvious forms (i++; or ++i;) for readability; micro-optimizations matter only for non-primitive iterators in other languages.
As noted, clearer subject lines help future readers — e.g., "C: meaning of & 1 and postfix ++".
Jump to Post— ~s.o.s~ 2,5601. X & 1 stands for bitwise AND ing of the unsigned variable X with 1.
2. b++ stands for post incrementing b which means that the value of b is incremented afer it has been used in teh expression.
1. X & 1 stands for bitwise AND ing of the unsigned variable X with 1.
2. b++ stands for post incrementing b which means that the value of b is incremented afer it has been used in teh expression.
And please for god sake choose a better subject.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.