bsc

Comprehensive codebase and cou...
Log | Files | Refs | Activity | README | LICENSE

root / semester_1 / R / Code / R_Code-14.r

R_Code-14.r (487B)


      1 # Write an if...else if...else block that evaluates a newly created temperature variable.
      2 # * If the temperature is strictly greater than 30, print: "30+ is too hot!"
      3 # * If the temperature is between 20 and 30 (inclusive), print: "Perfect weather."
      4 # * Otherwise, print: "It is quite cold." 
      5 
      6 temperature <- 29
      7 if(temperature > 30) {
      8     print("30+ is too hot!")
      9 } else if(temperature >= 20 && temperature <= 30) {
     10     print("Perfect weather")
     11 } else {
     12     print("It is quite cold.")
     13 }
© notamitgamer • Site Built: 2026-09-05 01:53:16 UTC • git-mirror commit: c170d72 [view raw info]
Originally created with stagit • modified by notamitgamer
Forked from github.com/notamitgamer/git-mirror