/****************************************************************************** Online C Compiler. Code, Compile, Run and Debug C program online. Write your code in this editor and press "Run" button to compile and execute it. *******************************************************************************/ #include <stdio.h> #include<stdbool.h> bool divisible(int n) { while(n%2==0 && n>1) { n=n/2; } return (n==1)?1:0; } int main() { //write a program to check if number is of power 2 or not //2 4 8 16 32 //2 10 12 printf("Hello World"); int n; scanf("%d",&n); printf("The above number is %s power of 2\n", divisible(n) ? "a" : "not a"); return 0; }