retagged by
685 views
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++;
		}
	}
}
  1. The value of count variable after execution of the above code?
  2. The value of count variable when $n = m$ ?

[EDITED] 

retagged by

1 Answer

3 votes
3 votes

hope it helps.......

Related questions

0 votes
0 votes
1 answer
1
rishu_darkshadow asked Nov 8, 2017
318 views
In C language, bitwise operation can be applied to which of the following operandsA. char B. int C. short, long ...
3 votes
3 votes
1 answer
2
dd asked Jun 27, 2017
496 views
#include <stdio.h int main() { unsigned int m = 0; m |= 0xA38; printf("%x\n",m|(m-1)); printf("%x\n",( (m|(m-1)) + 1 ) & m ); }Find the output ?
5 votes
5 votes
4 answers
4
Arjun asked Oct 18, 2016
1,321 views
What will be returned by the following function foo when called as foo(10)?int foo(int n) { return n & n | 1; }