#1. Write a loop that calculates 12-factorial

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

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

vect <- seq(20, 50, by=5)
print (vect)
## [1] 20 25 30 35 40 45 50

#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.

quadratic <- function(a,b,c) 
{
  block1 <- sqrt((b*b)-(4*a*c))
  sol1 <- (-b + block1)/(2*a)
  sol2 <- (-b - block1)/(2*a)
  
  print(sol1)
  print(sol2)
}
quadratic(1,3,-4)
## [1] 1
## [1] -4