Skip to content

Commit 09ebb78

Browse files
new
1 parent f288c80 commit 09ebb78

5 files changed

Lines changed: 24 additions & 7 deletions

File tree

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
public class positionofrightmostbit {
1+
public class magicnumber {
22
public static void main(String[] args) {
3-
int n=3;
3+
int n=6;
44
int pow = 1;
55
int count = 1;
66
int ans = 0;

Bitwise/src/rightmostbit.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
public class rightmostbit {
2+
public static void main(String[] args) {
3+
int n = 123456;
4+
int count = 1;
5+
while(n>0) {
6+
if ((n & 1) == 1) {
7+
System.out.println(count);
8+
n = 0;
9+
}
10+
else {
11+
count++;
12+
n = n >> 1;
13+
}
14+
}
15+
}
16+
}

Bitwise/src/rigthmostsetbit.java

Lines changed: 0 additions & 5 deletions
This file was deleted.
-780 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)