bsc

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

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

R_Code-9.r (285B)


      1 # Define a function called power that takes two parameters, 
      2 # a and b. Give a a default value of 2. The function should print the result 
      3 # of a raised to the power of b (a^b). 
      4 
      5 power <- function (a = 2, b) {
      6     return (a^b)
      7 }
      8 a <- 2
      9 b <- 3
     10 print(power(a, b))
     11 print(power("b" = b))
© 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