Hits: 96 Kotlin Program to Display Prime Numbers Between Intervals Using Function In this program, you’ll learn to display all prime numbers between the given intervals using a function in Kotlin. To find all prime numbers between two integers, checkPrimeNumber() function is created. Example: Prime Numbers Between Two Integers fun main(args: Array<String>) { var low …

Hits: 7 Kotlin Program to Display Armstrong Number Between Two Intervals In this program, you’ll learn to display all armstrong numbers between two given intervals, low and high, in Kotlin. A positive integer is called an Armstrong number of order n if abcd… = an + bn + cn + dn + … In case of an …

Hits: 5 Kotlin Program to Check Armstrong Number In this program, you’ll learn to check whether a given number is armstrong number or not. You’ll learn to do this by using a while loop in Kotlin. A positive integer is called an Armstrong number of order n if abcd… = an + bn + cn + dn …

Hits: 7 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 = …

Hits: 19 Kotlin Program to Check Whether a Number is Prime or Not In this article, you’ll learn to check whether a number is prime or not. This is done using a for-in loop in Kotlin. Example 1: Program to Check Prime Number using a for-in loop fun main(args: Array<String>) { val num = 29 …

Hits: 41 Kotlin Program to Calculate the Power of a Number In this program, you’ll learn to calculate the power of a number with and without using pow() function. Example 1: Calculate power of a number without using pow() fun main(args: Array<String>) { val base = 3 var exponent = 4 var result: Long = …

Hits: 19 Kotlin Program to Calculate the Power of a Number In this program, you’ll learn to calculate the power of a number with and without using pow() function. Example 1: Calculate power of a number without using pow() fun main(args: Array<String>) { val base = 3 var exponent = 4 var result: Long = …

Hits: 13 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’ …

Hits: 8 Kotlin Program to Find GCD of two Numbers In this program, you’ll learn to find GCD of two numbers in Kotlin. This is done by using while loop with the help of if else statement. The HCF or GCD of two integers is the largest integer that can exactly divide both numbers (without …

Hits: 7 Kotlin Program to Display Fibonacci Series In this program, you’ll learn to display fibonacci series in Kotlin using for and while loops. You’ll learn to display the series upto a specific term or a number. The Fibonacci series is a series where the next term is the sum of pervious two terms. The …

Hits: 55 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>) …

Hits: 9 Kotlin Program to Find Factorial of a Number In this program, you’ll learn to find the factorial of a number using for and while loop in Kotlin. You’ll also learn to use ranges to solve this problem. The factorial of a positive number n is given by: factorial of n (n!) = 1 * 2 …

Hits: 4 Kotlin Program to Calculate the Sum of Natural Numbers In this program, you’ll learn to calculate the sum of natural numbers using for loop and while loop in Kotlin. You’ll also see how ranges can be helpful for solving the problem. The positive numbers 1, 2, 3… are known as natural numbers and …

Hits: 10 Kotlin Program to Check Whether a Character is Alphabet or Not In this program, you’ll learn to check whether a given character is an alphabet or not. This is done using an if else statement or when expression in Kotlin. Example 1: Kotlin Program to Check Alphabet using if else fun main(args: Array<String>) …