#include<stdio.h>
int main()
{
int n;
printf("Eneter number\n");
scanf("%d", &n);
if( !(n & (n-1))){
printf("%d is power of 2\n", n);
return 0;
}
printf("%d is not power of 2 \n", n);
return 0;
}
int main()
{
int n;
printf("Eneter number\n");
scanf("%d", &n);
if( !(n & (n-1))){
printf("%d is power of 2\n", n);
return 0;
}
printf("%d is not power of 2 \n", n);
return 0;
}
Comments
Post a Comment