Files
  • main.rb
main.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
puts "What number would you like to use?"
a = gets.to_i

puts "What power will we bw giving to your number??"
b = gets.to_i

def to_the_power(c,d)
    return (c ** d)
end

answer = to_the_power(a, b)

puts "#{a} to the power of #{b} equals #{answer}"
ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-linux]