AmitDiwan has Published 10744 Articles

Kotlin Program to Calculate Simple Interest

AmitDiwan

AmitDiwan

Updated on 13-Oct-2022 12:53:38

436 Views

In this article, we will understand how to calculate the Simple Interest in Kotlin. It is the percentage interest on total principal amount. Returns are less compared to Compound Interest. Simple Interest is calculated using the formula (principle*rate*time)/100 Below is a demonstration of the same Suppose our input is ... Read More

Kotlin Program to Find Factorial of a number

AmitDiwan

AmitDiwan

Updated on 13-Oct-2022 12:51:24

2K+ Views

In this article, we will understand how to find the factorial of a number. Factorial of a number is the product of itself with each of its lower numbers. Below is a demonstration of the same − Suppose our input is Enter the number : 5 The desired output ... Read More

Kotlin Program to Check Armstrong Number between Two Integers

AmitDiwan

AmitDiwan

Updated on 13-Oct-2022 12:49:28

831 Views

In this article, we will understand how to display the Armstrong numbers between the given two numbers in Kotlin. An Armstrong number is a number that is equal to the sum of the cubes of its own digits. For example, 153 is 153 = (1)3 + (5)3 + (3)3 ... Read More

Kotlin Program to Display Alphabets (A to Z) using loop

AmitDiwan

AmitDiwan

Updated on 13-Oct-2022 12:47:18

1K+ Views

In this article, we will understand how to print alphabets from A to Z or a to z in Kotlin. This is accomplished using a simple for-loop. Below is a demonstration of the same Suppose our input is A to Z The desired output would be A B C ... Read More

Kotlin Program to Display All Prime Numbers from 1 to N

AmitDiwan

AmitDiwan

Updated on 13-Oct-2022 12:44:06

4K+ Views

In this article, we will understand how to display all the prime numbers from 1 to N in Kotlin. All possible positive numbers from 1 to infinity are called natural numbers. Prime numbers are special numbers who have only two factors 1 and itself and cannot be divided by any ... Read More

Kotlin Program to Find LCM of two Numbers

AmitDiwan

AmitDiwan

Updated on 13-Oct-2022 12:42:32

642 Views

In this article, we will understand how to calculate the LCM of two numbers in Kotlin. Lowest Common Multiple (LCM) of two numbers is the smallest positive integer that is evenly divisible by both the numbers. Below is a demonstration of the same Suppose our input is 24 and 18 ... Read More

Kotlin Program to Find GCD of two Numbers

AmitDiwan

AmitDiwan

Updated on 13-Oct-2022 12:39:09

811 Views

In this article, we will understand how to find the GCD of two numbers in Kotlin. Greatest Common Divisor (GCD) of two numbers is the largest number that divides both. Below is a demonstration of the same Suppose our input is Value 1 : 18 Value 2 : 24 ... Read More

Kotlin Program to Add Two Complex numbers

AmitDiwan

AmitDiwan

Updated on 13-Oct-2022 12:37:13

551 Views

In this article, we will understand how to add two complex numbers in Kotlin. They have the ‘I’ that is, an imaginary part associated with it. Below is a demonstration of the same − Suppose our input is 15 +i24 and 3 +i7 The desired output would be 18 ... Read More

Kotlin Program to Multiply Two Floating-Point Numbers

AmitDiwan

AmitDiwan

Updated on 13-Oct-2022 12:34:58

2K+ Views

In this article, we will understand how to multiply two floating-point numbers. A floating-point number, is a positive or negative whole number with a decimal point. There are two types of floating point in Kotlin Float Double Below is a demonstration of the same − Suppose our input ... Read More

Kotlin Program to Read The Number From Standard Input

AmitDiwan

AmitDiwan

Updated on 13-Oct-2022 12:28:31

463 Views

In this article, we will understand how to read a number from standard input in Kotlin. The ‘nextInt’ method is used to read the number. Below is a demonstration of the same Suppose our input is 45 The desired output would be The input value is 45 Algorithm ... Read More

Advertisements