Here is a solution to the triCheck problem!
triCheck<-function(){
a<-as.numeric(readline("Give me a number for side a: "))
b<-as.numeric(readline("Give me a number for side b: "))
c<-as.numeric(readline("Give me a number for side c: "))
a^2+b^2==c^2
if (a^2+b^2==c^2) {
cat("It's a right triangle!")
} else {
cat("Sorry, that is not a right triangle!")
}
}
Using the function, this is how I checked if it worked!
triCheck()
Give me a number for side a: 3
Give me a number for side b: 4
Give me a number for side c: 5
It's a right triangle!