Function to find the given number is a power of 2 or not?
Answer Posted / sahil
int ispwrof2(int num)
{
int temp = 0;
if(num <= 0)
return 0;
else if(num > 0)
{
while(num%2 == 0)
{
temp = num/2;
num = temp;
}
}
if(num == 1)
return 1;
else
return 0;
}
| Is This Answer Correct ? | 18 Yes | 7 No |
Post New Answer View All Answers
why wipro wase
List some of the static data structures in C?
Discuss the function of conditional operator, size of operator and comma operator with examples.
What is the size of a union variable?
which of the following is not a character constant a) 'thank you' b) 'enter values of p, n ,r' c) '23.56E-o3' d) all of the above
write a c program thal will find all sequences of length N that produce the sum is Zero, print all possible solutions?
How many levels of pointers can you have?
What is an operator?
What are the salient features of c languages?
Explain how can I make sure that my program is the only one accessing a file?
What is n in c?
What is the advantage of using #define to declare a constant?
#include show(int t,va_list ptr1) { int a,x,i; a=va_arg(ptr1,int) printf(" %d",a) } display(char) { int x; listptr; va_star(otr,s); n=va_arg(ptr,int); show(x,ptr); } main() { display("hello",4,12,13,14,44); }
What are the main characteristics of c language describe the structure of ac program?
Q.1 write a program to create binary tree 1 to 16 numbers? Q.2 write a program to creat a binary search tree for the member that is given by user?