Answer Posted / om
int f(int num)
{
if(( num>0) && (!(num & (num-1))) )
return 1;
else
return 0;
}
// f(16)...... 16 & 15 = 10000 & 01111 =00000
f(4) ...... 4 & 3 =0100 & 0111 =0000
f(11).......11 & 10 = 1011 & 1010 = 1010 so not...
f(12).......12 & 11 = 1100 & 1011 = 1000 so not...
| Is This Answer Correct ? | 6 Yes | 0 No |
Post New Answer View All Answers
What is pass by reference in c?
Find MAXIMUM of three distinct integers using a single C statement
Explain Function Pointer?
What are the 4 types of programming language?
What is your stream meaning?
Explain bit masking in c?
What is static function in c?
What is use of #include in c?
What are qualifiers?
What happens if header file is included twice?
What is formal argument?
In c programming write a program that will print 10 multiples of 3 except 15,18,21 using looping
What is extern c used for?
What is double pointer in c?
What are the c keywords?