R Programming: Take input from the user and display the values, print the version of R installation
R Programming: Basic Exercise-1 with Solution
Write a R program to take input from the user (name and age) and display the values. Also print the version of R installation.
Sample Solution :
R Programming Code :
name = readline(prompt="Input your name: ") age = readline(prompt="Input your age: ") print(paste("My name is",name, "and I am",age ,"years old.")) print(R.version.string)
Input your name: Input your age:  "My name is and I am years old."  "R version 3.4.4 (2018-03-15)"
R Programming Code Editor:
Have another way to solve this solution? Contribute your code (and comments) through Disqus.
Test your Python skills with w3resource's quiz
What is the difficulty level of this exercise?
- New Content published on w3resource:
- Scala Programming Exercises, Practice, Solution
- Python Itertools exercises
- Python Numpy exercises
- Python GeoPy Package exercises
- Python Pandas exercises
- Python nltk exercises
- Python BeautifulSoup exercises
- Form Template
- Composer - PHP Package Manager
- PHPUnit - PHP Testing
- Laravel - PHP Framework