Function to find the given number is a power of 2 or not?
Answer Posted / sudhesh
#include<stdio.h>
main()
{
int num,result;
printf("\nEnter the number:=");
scanf("%d",&num);
if (result=num&(num-1))
printf("No\n");
else
printf("Yes\n");
}
| Is This Answer Correct ? | 1 Yes | 3 No |
Post New Answer View All Answers
How can I write a function analogous to scanf?
What are the advantages of c language?
How can this be legal c?
Differentiate between the expression “++a” and “a++”?
we called a function and passed something do it we have always passed the "values" of variables to the called function. such functions calles are called a) calls by reference b) calls by value c) calls by zero d) none of the above
a=10;b= 5;c=3;d=3; if(a printf(%d %d %d %d a,b,c,d) else printf("%d %d %d %d a,b,c,d);
What is pragma in c?
can we have joblib in a proc ?
Difference between exit() and _exit() function?
What is a union?
write a program using linked list in which each node consists of following information. Name[30] Branch Rollno Telephone no i) Write the program to add information of students in linked list
Do string constants represent numerical values?
Which is best linux os?
What is a void * in c?
What is difference between structure and union with example?