In this
post, I am going to explain how to run code in R Studio.
Step 1: Open R Studio.
Step 2: File -> New File -> R script
Step 3: Type following code and save it as IfStmt.R
IfStmt.R
IfStmt.R
marks <- readline("enter your marks: ") if(marks < 35){ print("You are failed") }else if(marks >=35 & marks < 60){ print("Third class") }else if(marks >= 60 & marks < 70){ print("First class") }else if(marks >= 70 & marks <101 ){ print("Distinction") }else{ print("Wrong marks") }
No comments:
Post a Comment