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 Pentagon : ")
val s = scanner.nextDouble()
//Input Apothem
print("Enter Apothem of Pentagon : ")
val a = scanner.nextDouble()
//Area of Pentagon
val areaPentagon = (5.0/2.0)*s*a
//Print Area
println("Pentagon Area is :$areaPentagon")
}
Output
Run 1:
Run 1:
Enter Side of Pentagon : 5
Enter Apothem of Pentagon : 6
Pentagon Area is :75.0
---
Run 2:
Enter Side of Pentagon : 8
Enter Apothem of Pentagon : 6
Pentagon Area is :120.0
Program to find area of Pentagon in Kotlin
Output
need an explanation for this answer? contact us directly to get an explanation for this answer