R Basic For() Loops in R X <- 80:100 sum<-0 y=X[which(X%%2==0 )] for(i in y){sum = sum + i} print(sum)Enjoy coding