Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions ruby-methods/methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,26 @@
#"Phase-1 was all about Introduction to Programming."
#"Phase-2 was all about React."

# kip is the method name
# var1 and var2 are the parameters
def kip (var1 = "PH1ITP", var2 = "PH2REACT")

# statements to be executed
puts "First parameter is PH1ITP"
puts "First parameter is PH2REACT"
end

# calling method with parameters
kip "Phase-1 was all about Introduction to Programming", "Phase-2 was all about React"

puts ""

puts "Without Parameters"
puts ""
# calling method without passing parameters
kip


##Q4 Write a Ruby program which accept the user's first and last name and print them in reverse order with a
#space between them.

Expand Down