I was trying a tiny code with if statement, although it is very simple,but there is something I really confused here is the code
n<-857 while(n!=1){ if(n
You have to use {} for allows the if statement to have more than one line. Try this:
{}
if
n<-857 while(n!=1){ if(n<=0){ print("please input a positive integer") } else if(n%%2==0){ n<-n/2 print(n) } else { n<-3*n+1 print(n) } }