What's wrong with my code? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What's wrong with my code?

A number is fed to the input. You need to count it and output this number squared. Sample Input: 6 Sample Output: 36 puts "6" num = gets.chomp.to_i puts "6**2"

11th Jun 2022, 7:08 PM
NetStalker
NetStalker - avatar
3 Answers
+ 1
# Good Luck num = gets.chomp.to_i puts num**2
11th Jun 2022, 7:59 PM
SoloProg
SoloProg - avatar
+ 1
Thanks
11th Jun 2022, 8:01 PM
NetStalker
NetStalker - avatar
0
String denoted by " "
12th Jun 2022, 7:36 AM
A͢J
A͢J - avatar