Please create the following exercises in .rmd format, publish to rpub and submit both the .rmd file and the rpub link.
CalFactorial<- function(x){
num<-1
for(count in 1:x){
num<-num*((1:x)[count])
}
print(num)
}
CalFactorial(12)
## [1] 479001600
x<-seq(20, 50, 5)
x
## [1] 20 25 30 35 40 45 50
result<-function(a,b,c){
x1<-((-b)+sqrt((b^2)-4*a*c))/(2*a)
print(x1)
x2<-((-b)-sqrt((b^2)-4*a*c))/(2*a)
print(x2)
}
result(1,5,4)
## [1] -1
## [1] -4