Created
March 23, 2021 08:20
-
-
Save megabites2013/b51ce7e8f5b4e77b18332cb578b0df98 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def pow (baseNum, powNum) | |
result = 1 | |
powNum.times do |index| | |
result = result * baseNum | |
end | |
return result | |
end | |
puts pow(2,3) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment