logo codesdope
Level 1
1.
Print anything you want on the screen.
Answer
puts "I want to be a programmer"
									

2.
Store three integers in x, y and z. Print their sum.
Answer
x = 10
y = 15
z = 20
puts "#{x+y+z}"
									

3.
Store three integers in x, y and z. Print their product.
Answer
x = 5
y = 10
z = 20
puts "#{x*y*z}"
									

4.
Check class of following:
"CodesDope"
15
16.2
9.33333333333333333333
Answer
puts "CodesDope".class
puts 15.class
puts 16.2.class
puts 9.33333333333333333333.class
									

5.
Join two string using '+'.
E.g.-"Codes"+"Dope"
Answer
puts "Codes"+"Dope"
									

Doubt? Ask question
Close

Welcome.please sign up.

Close

Welcome.please login.