CODE:
#include<stdio.h>
int main()
{
int n;
printf(“Enter a value\n”);
scanf(“%d”,&n);
if((n &(n-1))==0)
printf(“no. is power of 2\n”);
else
printf(“no. is not power of 2\n”);
return 0;
}
CODE:
#include<stdio.h>
int main()
{
int n;
printf(“Enter a value\n”);
scanf(“%d”,&n);
if((n &(n-1))==0)
printf(“no. is power of 2\n”);
else
printf(“no. is not power of 2\n”);
return 0;
}
EmbLogic Research & Competency Development Labs
Phone: +91 9818467776, 8527567776, 9650467776
Email: info@emblogic.com
Copyright © EmbLogic Embedded Technologies Pvt. Ltd.