Write a loop that calculates 12-factorial

factorial <- 1 for (i in c(1:12)) { factorial <- factorial * i }

print(factorial)

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

vector <- seq(20, 50, by = 5)

print(vector)

Create the function “factorial” that takes a trio of input numbers a,b, and c and solve the quadratic equation. The function should print as output the two solutionsd the plot.

factorial<- function(a, b, c){

pos_root <-((-b) +sqrt((b^2)- 4ac))/(2*a)

neg_root <-((-b) -sqrt((b^2)- 4ac))/(2*a)

print(pos_root)

print(neg_root)

}

factorial(1,10,5)