#Krutika Patel

#Write a loop that calculates 12-factorial

x <- 1 for(i in 1:12) x=x*i print(x)

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

a <- 4:10 a <- a*5 print(a)

#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) { x1 <- (-b + (sqrt(4ac))/(2a)) x2 <- (-b - (sqrt(4ac))/(2a)) print(x1) print(x2) }

quadratic(1,5,6)