# How to change one bit of a 32 bit integer in C

I have three 32 bit integers a,b,c. I want to make 10th bit of a=(23 rd bit of b) xor (4th bit of c) without disturbing other bits of a. How can I do this in C programming language? a can be zero also. In that case I consider a= 00...0, 32 zeros.

• I'm voting to close this question as off-topic because it's really a question for Stack Overflow. – Bill Barth Apr 13 '15 at 15:19
• stackoverflow, per my understand, is for when the OP has code the needs to be debugged – user3629249 Apr 13 '15 at 15:25
• @user3629249: That is simply not true and the question is off-topic for SciComp.StackExchange.com. See this highly-rated question and its answers on StackOverflow: How do you set, clear and toggle a single bit in C/C++? – horchler Apr 13 '15 at 19:17
• I agree with horchler. Stack Exchange policy is not to migrate questions that already have accepted answers, even if the question is off-topic. Therefore, I will close the question and add a post notification to explain that this question is off-topic. – Geoff Oxberry Apr 13 '15 at 22:51

// 10th bit of a=(23 rd bit of b) xor (4th bit of c)