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 of Square
print("Enter Side of Square : ")
val side = scanner.nextDouble()
//Calculate Area of square
val squareArea = side*side;
//Print Area
println("Area of Square is : $squareArea")
}
Output
Run 1:
Enter Side of Square : 6
Area of Square is : 36.0
---
Run 2:
Enter Side of Square : 4.5
Area of Square is : 20.25
Program to find area of Square in Kotlin
Output
need an explanation for this answer? contact us directly to get an explanation for this answer