Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 32 additions & 1 deletion BMI_TAhmad
Original file line number Diff line number Diff line change
@@ -1 +1,32 @@
Hello this is a test.
<<<<<<< Updated upstream
calculate_bmi <- function(weight_kg, height_m) {
=======
# Calculate BMI
bmi <- calculate_bmi(weight_kg, height_m)
print(paste("The BMI is", bmi))calculate_bmi <- function(weight_kg, height_m) {
>>>>>>> Stashed changes
# Check if the input values are valid
if(weight_kg <= 0 || height_m <= 0) {
stop("Weight and height must be greater than zero.")
}

# Calculate BMI
bmi <- weight_kg / (height_m^2)

# Return the calculated BMI
return(bmi)
}

<<<<<<< Updated upstream
#Example
# weight in kilograms
weight_kg <- 70
# height in meters
height_m <- 1.75
=======
# Example usage:
# weight in kilograms
weight_kg <- 70
# height in meters
height_m <- 1.75
>>>>>>> Stashed changes