This is a sample program which takes user input and prints the same in Ruby
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HI..!! enter ur name please: Test User | |
Hello Test User |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print('HI..!! enter ur name please: ') | |
name = gets() | |
puts("Hello #{name}") | |
#this symbol is mainly used for comments.. what role is it playing here..?? | |
# the hash symbol in the puts stmnt above within quotes can be used to print the value of the entity within the quotes | |
puts("\n") | |
#<<name |
No comments:
Post a Comment