Function to find the given number is a power of 2 or not?
Answer Posted / abhinay
main()
{
int n,m;
do
{
m=n%2;
n=m;
}
while(n>1);
if(m==1)
{
Printf("Number is not a power of 2");
}
else
{
printf("Number is a power of 2");
}
}
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Draw a diagram showing how the operating system relates to users, application programs, and the computer hardware ?
program to find error in linklist.(i.e find whether any node point wrongly to previous nodes instead of next node)
What is call by value in c?
a value that does not change during program execution a) variabe b) argument c) parameter d) none
#include main() { int *p, *c, i; i = 5; p = (int*) (malloc(sizeof(i))); printf(" %d",*p); *p = 10; printf(" %d %d",i,*p); c = (int*) calloc(2); printf(" %d ",*c); }
What is the value of a[3] if integer a[] = {5,4,3,2,1}?
State the difference between x3 and x[3].
How will you declare an array of three function pointers where each function receives two ints and returns a float?
Where define directive used?
What are the types of bitwise operator?
How can I call fortran?
How are pointers declared in c?
How can I call system when parameters (filenames, etc.) Of the executed command arent known until run time?
What is the function of volatile in c language?
What is static function in c?