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 ? | 3 Yes | 0 No |
Post New Answer View All Answers
Calculate the weighted average of a list of n numbers using the formula xavg = f1x1+f2x2+ ….+ fnxn where the f’s are fractional weighting factors, i.e., 0<=fi<1, and f1+f2+….+fn = 1
What is sorting in c plus plus?
What are the features of c languages?
Why is c called c not d or e?
Where does the name "C" come from, anyway?
What is define directive?
why do some people write if(0 == x) instead of if(x == 0)?
Are enumerations really portable?
What is a class c rental property?
What is the difference between array and pointer?
What is volatile keyword in c?
Is r written in c?
Explain what are run-time errors?
Tell us bitwise shift operators?
please help me..... please codes and flowchart plz turbo c lang po yan.....please asap response... 3. Make an astrology program. The user types in his or her birthday (month, day, and year as integer), and the program responds with the user’s zodiac sign, horoscope, and other information related to it. If the user’s birth year falls into a leap year, your program should display an appropriate message for it. NOTES: Conditional Statements: it should be with graphics