Function to find the given number is a power of 2 or not?

Answer Posted / sheikh rasel

#include<stdio.h>
main()
{
int i;
if(i%2=0)
printf("The given number is a power of 2");
else
printf("The given number is not a power of 2");
return 0;
}

Is This Answer Correct ?    6 Yes 133 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does typedef struct mean?

665


Differentiate between Macro and ordinary definition.

735


In C language what is a 'dangling pointer'?

644


Explain what is the stack?

639


Differentiate between full, complete & perfect binary trees.

676






How can you increase the allowable number of simultaneously open files?

599


Is c call by value?

613


What is the difference between strcpy() and memcpy() function in c programming?

630


Why n++ execute faster than n+1 ?

1856


What is the size of empty structure in c?

598


Badboy is defined who has ALL the following properties: Does not have a girlfriend and is not married. He is not more than 23 years old. The middle name should be "Singh" The last name should have more than 4 characters. The character 'a' should appear in the last name at least two times. The name of one of his brothers should be "Ram" Write a method: boolean isBadBoy(boolean hasGirlFriend , boolean isMarried, int age , String middleName , String lastName , String[] brotherName); isHaveGirlFriend is true if the person has a girlfriend isMarried is true if the person is married age is the age of the person middleName is the middle name of the person lastName is the last name of the person brotherName is the array of the names of his brothers

1429


How many identifiers are there in c?

587


Can we declare function inside main?

572


How can you increase the size of a statically allocated array?

622


Explain about block scope in c?

664