Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/PrajaktaSathe/Java
/ calculateLength
Method
calculateLength
Programs/Decimal_to_Binary.java:13–20 ·
view source on GitHub ↗
(int n)
Source
from the content-addressed store, hash-verified
11
}
12
13
static
int
calculateLength(
int
n){
14
int
count =0;
15
while
(n>0){
16
n = n/2;
17
count++;
18
}
19
return
count;
20
}
21
22
static
void
calculateBinary(
int
n,
int
positions){
23
// int count = 0;
Callers
1
main
Method · 0.95
Calls
no outgoing calls
Tested by
no test coverage detected