Below is the program
factorial <- function(x) {
if x<=0 {
return 0
}
fact <- 1
for (i in 1:x) {
fact <- fact * i
}
sprintf("Factorial of %d is %d ",x,fact)
return fact
}
factorial(12)
print(seq(from = 20, to = 50, by = 5))