Function to find the given number is a power of 2 or not?
Answer Posted / ms
int ispow2(int number)
{
if(n<o) {
return 0;
}
else {
return !(number&(number-1));
}
| Is This Answer Correct ? | 76 Yes | 13 No |
Post New Answer View All Answers
Why is c called "mother" language?
Explain how does free() know explain how much memory to release?
program to find out date after adding 31 days to a date in the month of febraury also consider the leap year
How does sizeof know array size?
What are the types of type qualifiers in c?
How many keywords are there in c?
What does int main () mean?
What are the different data types in C?
How do you print an address?
Was 2000 a leap year?
What are the types of data structures in c?
How are strings stored in c?
Why void is used in c?
How arrays can be passed to a user defined function
main() { struct s1 { char *str; struct s1 *ptr; }; static struct s1 arr[] = { {"Hyderabad",arr+1}, {"Bangalore",arr+2}, {"Delhi",arr} }; struct s1 *p[3]; int i; < BR> for(i=0;i<=2;i++) p[i] = arr[i].ptr; printf("%s ",(*p)->str); printf("%s ",(++*p)->str); printf("%s ",((*p)++)->str); }