@christinaSmith/

to_the_power_ruby

Ruby

No description

fork
loading
Files
  • main.rb

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.09856417221609903","path":"main.rb","file":{"path":"main.rb","content":{"asEncoding":{"base64":"cHV0cyAiV2hhdCBudW1iZXIgd291bGQgeW91IGxpa2UgdG8gdXNlPyIKYSA9IGdldHMudG9faQoKcHV0cyAiV2hhdCBwb3dlciB3aWxsIHdlIGJ3IGdpdmluZyB0byB5b3VyIG51bWJlcj8/IgpiID0gZ2V0cy50b19pCgpkZWYgdG9fdGhlX3Bvd2VyKGMsZCkKICAgIHJldHVybiAoYyAqKiBkKQplbmQKCmFuc3dlciA9IHRvX3RoZV9wb3dlcihhLCBiKQoKcHV0cyAiI3thfSB0byB0aGUgcG93ZXIgb2YgI3tifSBlcXVhbHMgI3thbnN3ZXJ9Ig=="},"asBuffer":null},"loaded":true}}
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.5p157 (2019-03-15 revision 67260) [x86_64-linux]