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
Which is better oop or procedural?
Which header file is used for clrscr?
main use of recursive function a) processing speed high b) reduce program length/reduce repeated statements c) if you do not, use iterative methods like, for, while or do-while d) all the above
What is the difference between a free-standing and a hosted environment?
Explain what is wrong with this program statement? Void = 10;
Write a c program to build a heap method using Pointer to function and pointer to structure ?
how can i access hard disk address(physical address)? are we access hard disk by using far,near or huge pointer? if yes then please explain.....
A float occupies 4 bytes in memory. How many bits are used to store exponent part? since we can have up to 38 number for exponent so 2 ki power 6 6, 6 bits will be used. If 6 bits are used why do not we have up to 64 numbers in exponent?
What is structure packing in c?
What is the hardest programming language?
What is f'n in math?
What math functions are available for integers? For floating point?
What is the purpose of the preprocessor directive error?
how to write a c program to print list of fruits in alpabetical order?
Explain which of the following operators is incorrect and why? ( >=, <=, <>, ==)