Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUBY

Ruby | Methods

# Ruby program to illustrate the defining
# and calling of method
 
#!/usr/bin/ruby
 
# Here geeks is the method name
def geeks
 
# statements to be displayed
puts "Welcome to GFG portal"
 
# keyword to end method
end
 
# calling of the method
geeks
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #Ruby #Methods
ADD COMMENT
Topic
Name
9+9 =