#include <stdio.h>
int main( )
{
int n = 0;
int input = 0;
do
{
printf("Enter Number\n");
scanf("%d", &n);
if (!(n & n-1))
{
printf("Number is power of two\n");
}
printf("Do u want to continue. Press 0 to exit or 1 to continue\n");
scanf("%d", &input);
}
while(input == 1);
return 0;
}
In short, if output of number "n" & "n-1" results zero it means number "n" is power