Sum of squares of even numbers up to a limit

Report a typo

Write a program in Kotlin that displays the sum of squares of even numbers from 1 up to a given limit. Take the limit as an integer input from the user. If the limit is less than 0, print 'Invalid Input'.

Sample Input 1:

10

Sample Output 1:

220

Sample Input 2:

5

Sample Output 2:

20
Write a program in Kotlin
import java.util.Scanner

fun main(args: Array<String>) {
// Create a Scanner object for taking input
val reader = Scanner(System.`in`)

// Read an integer input
val limit = reader.nextInt()

// Check if limit is less than 0
if (limit < 0) {
println("Invalid Input")
} else {
// Write a loop here to calculate the sum of squares of even numbers up to the limit
// Use the 'repeat' construct
// After calculating the sum, print it
}
}

Create a free account to access the full topic