Skip to content

Commit

Permalink
Create kV3zkm.swift
Browse files Browse the repository at this point in the history
Signed-off-by: monicknog <[email protected]>
  • Loading branch information
monicknog authored and CodingWithHardik committed Oct 6, 2023
1 parent 5782dc9 commit 183f693
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions nlyPgJ/kV3zkm.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import Foundation
func calculateCubeVolume(sideLength: Double) -> Double {
let volume = sideLength * sideLength * sideLength
return volume
}

func main() {
// Input the side length of the cube
let sideLength = 5.0

// Calculate the volume of the cube using the function
let volume = calculateCubeVolume(sideLength: sideLength)

// Print the result
print("The volume of the cube with a side length of \(sideLength) units is \(volume) cubic units.")
}

// Call the main function to execute the program
main()

0 comments on commit 183f693

Please sign in to comment.