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 Base of Parallelogram
print("Enter Parallelogram Base : ")
val b = scanner.nextDouble()
//Input Height of Parallelogram
print("Enter Parallelogram Height : ")
val h = scanner.nextDouble()
//Calculate Area of Parallelogram
val areaParallelogram = b * h
//Print Area
println("Area of Parallelogram is :$areaParallelogram")
}
Output
Run 1:
Enter Parallelogram Base : 5
Enter Parallelogram Height : 8
Area of Parallelogram is :40.0
---
Run 2:
Enter Parallelogram Base : 5.7
Enter Parallelogram Height : 3
Area of Parallelogram is :17.1
Program to find area of Parallelogram in Kotlin
Output
need an explanation for this answer? contact us directly to get an explanation for this answer