Update iterative_decimal_to_binary.rb

This commit is contained in:
Vitor Oliveira 2021-03-06 11:48:27 -08:00 committed by GitHub
parent 1fb0258c8e
commit 446b0e3085
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,7 +6,7 @@ def decimal_to_binary(n)
bin << n % 2
n = n / 2
end
return bin.reverse.join
bin.reverse.join
end
puts 'Binary value of 4 is ' + decimal_to_binary(4).to_s