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
Explain what is a program flowchart and explain how does it help in writing a program?
What are conditional operators in C?
You are to write your own versions of strcpy() and strlen (). Call them mystrcpy() and mystrlen(). Write them first as code within main(), not as functions, then, convert them to functions. You will pass two arrays to the function in the case of mystrcpy(), the source and target array.
What is the purpose of the statement: strcat (S2, S1)?
A global variable when referred to in another file is declared as this a) local variable b) external variable c) constant d) pointers
Write a program for finding factorial of a number.
What is calloc() function?
What is static memory allocation? Explain
Find duplicates in a file containing 6 digit number (like uid) in O (n) time.
What does a pointer variable always consist of?
Can a pointer be static?
Write a program to print all permutations of a given string.
What is property type c?
Write a C program to accept a matrix of any size. Find the frequency count of each element in the matrix and positions in which they appear in the matrix
The % symbol has a special use in a printf statement. Explain how would you place this character as part of the output on the screen?