Day: May 5, 2021

Kotlin example for Beginners – Kotlin Program to Display Prime Numbers Between Two Intervals

Kotlin Program to Display Prime Numbers Between Two Intervals In this program, you’ll learn to display prime numbers between two given intervals, low and high. You’ll learn to do this using a while and a for loop in Kotlin. Example: Display Prime Numbers Between two Intervals fun main(args: Array<String>) { var low = 20 val …

Kotlin example for Beginners – Kotlin Program to Display Characters from A to Z using loop

Kotlin Program to Display Characters from A to Z using loop In this program, you’ll learn to print English alphabets using while loop in Kotlin. You’ll also learn learn to print only uppercased and lowercased alphabets. Example 1: Display Uppercased A to Z fun main(args: Array<String>) { var c: Char c = ‘A’ while (c …

Kotlin example for Beginners – Kotlin Program to Generate Multiplication Table

Kotlin Program to Generate Multiplication Table In this program, you’ll learn to generate multiplication table of a given number. This is done by using a for and a while loop in Kotlin. You’ll also learn to use ranges to solve the problem. Example 1: Generate Multiplication Table using for loop fun main(args: Array<String>) { val …