#include <stdio.h>
main()
{
int num = 0;
printf("Enter number:");
scanf("%d",&num);
if ( !(num & (num-1)) )
{
printf("Power of two\n");
} else {
printf("Not a power of two\n");
}
}
No comments:
Post a Comment