Task 1: Write a loop that calculates 12 factorial

# calc 12 factorial
fact12 = 1
for (i in 12:1)
  {
  fact12 <- (fact12 * i)
#  print (fact12)
#  print (i)
  }
print (fact12)
## [1] 479001600

Task 2: Show how to create a numeric vector that contains the sequence from 20 to 50 by 5.

# calc 12 factorial
num_vector <- seq(from=20, to=50, by=5)
num_vector
## [1] 20 25 30 35 40 45 50

Task 3: Create the function “quadratic” that takes a trio of input numbers a, b, and c and solve the quadratic equation. The function should print as output the two solutions.

This is the quadratic equation: \(x = \frac {-b \pm \sqrt{b^2 - 4ac}} {2a}\)

Note: R code for displaying quadratic equation found on RMarkdown video

quadratic <- function(a,b,c)
{
  x1 <- ((-b) + (sqrt((b^2- (4*(a*c))))))/(2*a)
  print (x1)
  
  x2 <- ((-b) - (sqrt((b^2- (4*(a*c))))))/(2*a)
  print (x2)
}

quadratic (1,-2,-15)
## [1] 5
## [1] -3

Looking forward to your feedback! Thank you, Rick