R_Code-9.r (411B)
1 # Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 19 Mar 2026 2 # Repo: https://github.com/notamitgamer/bsc 3 # License: MIT 4 5 # Define a function called power that takes two parameters, 6 # a and b. Give a a default value of 2. The function should print the result 7 # of a raised to the power of b (a^b). 8 9 power <- function (a = 2, b) { 10 return (a^b) 11 } 12 a <- 2 13 b <- 3 14 print(power(a, b)) 15 print(power("b" = b))