Given an unsigned integer, find if the number is power of 2?
Answer Posted / veerendra jonnalagadda
main()
{
int i;
printf("Enter Number :");
scanf("%d",&i);
if(i&(i-1))
printf("Not atwo power");
else
printf("Two 's Power");
}
Is This Answer Correct ? | 5 Yes | 0 No |
Post New Answer View All Answers
What are the rules for the identifier?
What is scope of variable in c?
how to execute a program using if else condition and the output should enter number and the number is odd only...
What is the general form of function in c?
Linked list is a Linear or non linear explain if linear how it working as a non linear data structures
How many identifiers are there in c?
What is identifiers in c with examples?
Declare the structure which contains the following members and write in C list of all students who score more than 75 marks. Roll No, Name, Father Name, Age, City, Marks.
Hai sir, I had planned to write the NIC scientific engineer exam , plz post the sample question......
What are the types of pointers?
What is cohesion and coupling in c?
What is the basic structure of c?
Tell us two differences between new () and malloc ()?
What are predefined functions in c?
What is table lookup in c?