+ 2

How to find the given no is odd or even using pointer to structure

C language

4th Apr 2020, 11:18 AM
Bharathkannan R
Bharathkannan R - avatar
6 ответов
+ 1
look at the (LSB) least significant bit using the & operator to any particular integer to which you are pointing at within the structure. We need code to know exactly what you are doing though. :) if(num->n & 1) { printf("odd"); } else printf("even"); return 0;
15th Apr 2020, 7:12 PM
Brett Dahmer
Brett Dahmer - avatar
+ 2
Any one solve this
4th Apr 2020, 11:18 AM
Bharathkannan R
Bharathkannan R - avatar
+ 2
Ok thanks for your response
4th Apr 2020, 11:24 AM
Bharathkannan R
Bharathkannan R - avatar
+ 2
Ok
4th Apr 2020, 11:29 AM
Bharathkannan R
Bharathkannan R - avatar
0
try by yourself first, then ask for help here if you encounter any issues. https://www.sololearn.com/discuss/1316935/?ref=app
4th Apr 2020, 11:23 AM
John Robotane
John Robotane - avatar
0
just show your attempt, even if it doesn't work, we will try to fix it.
4th Apr 2020, 11:28 AM
John Robotane
John Robotane - avatar