0 votes 0 votes int main() { int n = 3,i,count=0; for(i=0;i<1<<n;i++) { int p = i; while(p) { int k = p & -p; p = p - k; count++; } } } The value of count variable after execution of the above code? The value of count variable when $n = m$ ? [EDITED] Programming in C programming-in-c bitwise + – dd asked Apr 20, 2017 retagged Jun 4, 2017 by Arjun dd 688 views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
3 votes 3 votes hope it helps....... akash.dinkar12 answered Apr 20, 2017 akash.dinkar12 comment Share Follow See all 6 Comments See all 6 6 Comments reply Show 3 previous comments dd commented Apr 20, 2017 reply Follow Share @akash.dinkar12 : sorry: I am changing $m$ with $k$ inside the code. 1 votes 1 votes akash.dinkar12 commented Apr 21, 2017 reply Follow Share ur previous code current code Output should remain same, how can replacement affect the output by only changing the name of variable.... 0 votes 0 votes dd commented Apr 21, 2017 reply Follow Share I did not mean that: I changed $m$ because I also mentioned $n = m$ statement:: not to confuse , I changed $m$ with $k$ inside the code. 0 votes 0 votes Please log in or register to add a comment.