Skip to content

Commit 98b3f96

Browse files
authored
Created CheckPowerof2.c
Used C Language
1 parent 5f16c70 commit 98b3f96

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#include<stdio.h>
2+
#define int long long int
3+
4+
#undef int
5+
6+
int main()
7+
{
8+
#define int long long int
9+
10+
int n;
11+
scanf("%lld", &n);
12+
13+
if((n&(n-1))==0)
14+
{
15+
printf("Yes, the number is a power of two\n");
16+
}
17+
18+
else
19+
printf("No, the number is not a power of two\n");
20+
21+
return 0;
22+
}

0 commit comments

Comments
 (0)