1. Write an R script to display "Hello, World!" and save it in RStudio.
2. Perform basic arithmetic operations in R (addition, subtraction, multiplication, division,
and modulus).
3. Create a sequence of numbers from 1 to 20 and calculate the mean, median, and sum of
the sequence.
4. Create variables of different data types: numeric, character, logical, and print their values.
5. Write an R script to check if a number is positive, negative, or zero using an if-else
statement.
6. Write an R script to print numbers from 1 to 100 using a for loop.
7. Write an R script to calculate the factorial of a number using a while loop.
8. Use a switch statement to perform a basic calculator function: addition, subtraction,
multiplication, or division.
9. Write an R script to print the current date, time, and session information.
10. Write an R script to find the largest of three numbers using nested if-else statements.
11. Write an R script to calculate the sum of all even numbers from 1 to 100 using a for loop.
12. Write an R script to print the Fibonacci series up to a given number using a while loop.
13. Write a function in R to check if a number is prime.
14. Use a for loop to calculate the sum of the first 50 natural numbers.
15. Use a while loop to reverse the digits of a number.