dimanche 1 août 2021

Please help me debug my code in R for finding odd and even [closed]

x <- (readline(prompt = "Enter number :" ))
 as.numeric(x) 
 if(x%% 2 ==0) {
 print("x is even")
 } else {
 print("x is odd") 
 }

Error in x%%2 : non-numeric argument to binary operator

Aucun commentaire:

Enregistrer un commentaire