Function to find the given number is a power of 2 or not?
Answer Posted / sudhesh
#include<stdio.h>
main()
{
int num,result;
printf("\nEnter the number:=");
scanf("%d",&num);
if (result=num&(num-1))
printf("No\n");
else
printf("Yes\n");
}
| Is This Answer Correct ? | 1 Yes | 3 No |
Post New Answer View All Answers
Write a program to input the price of 1 burger and the number of burgers eaten by a group of friends .print the total amount to be paid by the group?
Explain the difference between exit() and _exit() function?
#include main() { char s[] = "Bouquets and Brickbats"; printf(" %c, ",*(&s[2])); printf("%s, ",s+5); printf(" %s",s); printf(" %c",*(s+2)); }
what type of questions arrive in interview over c programming?
What are the advantages of using linked list for tree construction?
What does p mean in physics?
What language is lisp written in?
What is null pointer in c?
What are the types of type specifiers?
write a program using linked list in which each node consists of following information. Name[30] Branch Rollno Telephone no i) Write the program to add information of students in linked list
Explain what are the different file extensions involved when programming in c?
to print the salary of an employee according to follwing calculation: Allowances:HRA-20% of BASIC,DA-45% of BASIC,TA-10%. Deductions:EPF-8% of BASIC,LIC-Rs.200/-Prof.Tax:Rs.200/- create c language program?
Explain how can you determine the size of an allocated portion of memory?
Explain how do you convert strings to numbers in c?
When can a far pointer be used?