Write a loop that calculates 12-factorial

x= 1

for(i in 1:12) 

{              
  
  x = x * i          
  
}

print(x)
## [1] 479001600

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

num_vec = c(20, 25, 30, 35, 40, 45, 50)

print(num_vec)
## [1] 20 25 30 35 40 45 50

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.

quadratic_calculator =  function(a, b,c)
{
  
  vecx =c((-b + sqrt(b^2 - 4 * a * c)) / (2 * a),
          (-b - sqrt(b^2 - 4 * a * c)) / (2 * a))
  
  print(vecx)
}


quadratic_calculator(a = 2, b = -3, c = 1)
## [1] 1.0 0.5