package com.includehelp
import java.util.*
//Main Function , Entry point of Program
fun main(args: Array<String>) {
//Input Stream
val scanner = Scanner(System.`in`)
//Input side
print("Enter Side of Cube : ")
val side = scanner.nextDouble()
//Cube Surface Area
val areaCube = 6*Math.pow(side, 2.toDouble())
//Print Area
println("Cube Surface Area on Side ($side) is :$areaCube")
}
Output
Run 1:
Enter Side of Cube : 5
Cube Surface Area on Side (5.0) is :150.0
---
Run 2:
Enter Side of Cube : 12
Cube Surface Area on Side (12.0) is :864.0
Program to find area of a cube in Kotlin
Output
need an explanation for this answer? contact us directly to get an explanation for this answer