AmitDiwan has Published 11365 Articles

Kotlin Program to Print the ASCII values

AmitDiwan

AmitDiwan

Updated on 13-Oct-2022 13:06:58

689 Views

In this article, we will understand how to print ascii values of characters. This is done by assigning the character to an integer value and printing those integer values. Below is a demonstration of the same Suppose our input is − Enter a character: s The desired output would ... Read More

Kotlin Program to Find the Surface Area and Volume of Cuboid

AmitDiwan

AmitDiwan

Updated on 13-Oct-2022 13:04:44

190 Views

In this article, we will understand how to compute the surface area and volume the cuboid. The surface area of cuboid is calculated using the formula − 2*( length *width + width* height + height*length) The Volume of the cuboid is calculated using the formula length*width*height Below is ... Read More

Kotlin Program to Find the Area of a Circle

AmitDiwan

AmitDiwan

Updated on 13-Oct-2022 13:02:26

933 Views

In this article, we will understand how find the area of a circle. Area of a circle is calculated by using the formula − (pie*radius*radius)/7 Below is a demonstration of the same Suppose our input is Radius of the circle: 5 The desired output would be − The ... Read More

Kotlin Program to Find the Perimeter of a Rectangle

AmitDiwan

AmitDiwan

Updated on 13-Oct-2022 13:00:11

354 Views

In this article, we will understand how to find the perimeter of a rectangle. The Perimeter of a rectangle is calculated using the following formulae 2*(length + width) Below is a demonstration of the same − Suppose our input is The length of the sides of a rectangle are: ... Read More

Kotlin Program to Calculate Compound Interest

AmitDiwan

AmitDiwan

Updated on 13-Oct-2022 12:57:52

362 Views

In this article, we will understand how to calculate the Compound interest. The percentage interest charged on principal and accrued interest is Compound Interest. Rates are higher compared to Simple Interest. Compound Interest is calculated using the formula principle * (Math.pow((1 + rate / 100), time)) – principle Below ... Read More

Kotlin Program to Calculate Simple Interest

AmitDiwan

AmitDiwan

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

252 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

651 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

778 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

3K+ 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

Advertisements