Function to find the given number is a power of 2 or not?
Answer Posted / sheikh rasel
#include<stdio.h>
main()
{
int i;
if(i%2=0)
printf("The given number is a power of 2");
else
printf("The given number is not a power of 2");
return 0;
}
| Is This Answer Correct ? | 6 Yes | 133 No |
Post New Answer View All Answers
Does c have function or method?
What is actual argument?
Explain what are the advantages and disadvantages of a heap?
Which one to choose from 'initialization lists' or 'assignment', for the use in the constructor?
For what purpose null pointer used?
When can you use a pointer with a function?
If a five digit number is input through the keyboard, write a program to print a new number by adding one to each of its digits.For example if the number that is input is 12391 then the output should be displayed as 23402
What is wild pointer in c with example?
Why do we write return 0 in c?
program to find out date after adding 31 days to a date in the month of febraury also consider the leap year
What will the code below print when it is executed? int x = 3, y = 4; if (x = 4) y = 5; else y = 2; printf ("x=%d, y=%d ",x,y);
When should a type cast be used?
Why clrscr is used after variable declaration?
What is the role of this pointer?
What is c++ used for today?