Skip to main content

Posts

Showing posts from February, 2014

wap to check whether an integer is a power of 2..

#include<stdio.h> main() { int n,i; printf("\nenter the number\n"); scanf("%d",&n); i=n-1; if((n&i)==0)    printf("\ninteger is a power of 2\n"); else    printf("\ninteger is not a power of 2\n"); }