Given an unsigned integer, find if the number is power of 2?
Answer Posted / asis bera
main()
{
unsigned int n;
printf("enter the number:\n");
scanf("%u",&n);
if(i&(i-1))
printf(" not power of two\n");
else
printf("power of two...\n");
}
Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
Is r written in c?
How can I get random integers in a certain range?
What Is The Difference Between Null And Void Pointer?
What is the difference between text and binary modes?
Explain what are global variables and explain how do you declare them?
how is the examination pattern?
Write the program with at least two functions to solve the following problem. The members of the board of a small university are considering voting for a pay increase for their 10 faculty members. They are considering a pay increase of 8%. Write a program that will prompt for and accept the current salary for each of the faculty members, then calculate and display their individual pay increases. At the end of the program, print the total faculty payroll before and after the pay increase, and the total pay increase involved.
Is there any possibility to create customized header file with c programming language?
What is the difference between exit() and _exit() function in c?
write a program to reverse a every alternetive words in a string in a place. EX: Input is "this is the line of text" Output should be "shit is eht line fo text" Please any one tell me code for that.
What is break in c?
about c language
List out few of the applications that make use of Multilinked Structures?
Why cant I open a file by its explicit path?
simple program of graphics and their output display