R_Code-12.r (511B)
1 # Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 20 Mar 2026 2 # Repo: https://github.com/notamitgamer/bsc 3 # License: MIT 4 5 # Write a custom function named calculate_area that takes 6 # two parameters: length and width. The width parameter should have 7 # a default value of 5. The function should print the product of the 8 # two parameters. Finally, call your function passing only the value 12 for the length. 9 10 calculate_area <- function(length, width = 5) { 11 print(length * width) 12 } 13 14 calculate_area(12)