MIPI_AdvancedC_FRTK/Lect1/17_task_8_page_25.c

18 lines
242 B
C
Raw Permalink Normal View History

2024-11-14 08:45:50 +03:00
#include <stdio.h>
#include <stdint.h>
_Bool isPowerOfFour(uint32_t n)
{
return n != 0 && ((n&(n-1)) == 0) && !(n & 0xAAAAAAAA);
}
int main ()
{
int32_t a;
scanf("%d",&a);
printf("%s", isPowerOfFour(a) ? "YES" : "NO");
return 0;
}