English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The best way to learn Kotlin is through practice examples. This page contains examples of basic Kotlin concepts. It is recommended that you learn from these examples and then try them yourself.
All programs on this page have been tested and can run on all platforms.
Kotlin program to find the largest number among three numbers
Kotlin program to find the GCD (Greatest Common Divisor) of two numbers
Kotlin program to display characters from A to Z using a loop
Kotlin program to calculate the number of digits in an integer
Kotlin programs to display prime numbers between two intervals
Kotlin programs to display Armstrong numbers between two intervals
Kotlin programs to display prime numbers between two intervals using a function
Kotlin programs to display Armstrong numbers between two intervals using a function
Kotlin programs to create a simple calculator using switch ... case
Kotlin programs to check if a number can be represented as the sum of two prime numbers
Kotlin programs to find the sum of natural numbers using recursion
Kotlin programs to find the factorial of a number using recursion
Kotlin programs to add two matrices using a multi-dimensional array
Kotlin programs to multiply a matrix with a multi-dimensional array
Kotlin programs to multiply two matrices by passing them to a function
Kotlin programs to find the frequency of characters in a string
Kotlin programs calculate the number of vowels and consonants in a sentence
Kotlin programs sort elements in alphabetical order (dictionary order)
Kotlin programs add two complex numbers by passing a class to a function
Kotlin programs to calculate the time difference between two time periods