Days forward

Report a typo

The function daysForward(date: String, days: Int), where date is an ISO 8601 string representing a date (for example, 2000-01-01) and days is an integer representing the number of days, prints an ISO 8601 string representing the date that comes days days after the date.

For example, if date is 2022-01-01 and days is 137, then this function prints 2022-05-18.

Write the correct code for the daysForward() function.

Sample Input 1:

2000-01-01
15

Sample Output 1:

2000-01-16
Write a program in Kotlin
import kotlinx.datetime.*

fun daysForward(date: String, days: Int) {
// Write your code here

//
}

fun main() {
val date = readLine()!!
val days = readLine()!!.toInt()
daysForward(date, days)
}
___

Create a free account to access the full topic