Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; SEOFriendlyImages has a deprecated constructor in /home/tutorig3/public_html/wp-content/plugins/seo-image/seo-friendly-images.class.php on line 2

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /home/tutorig3/public_html/wp-content/themes/mts_interactive/options/php-po/php-po.php on line 185
Kotlin program to find Quotient and Remainder - Tutorialwing

# Kotlin program to find Quotient and Remainder

###### Greetings!
We have recently published 100+ articles on android tutorials with kotlin and java. If you need, you may visit Android Tutorial for beginners page. You can also check Kotlin Tutorial for beginners. Also, if you are interested in content writing, you can mail us at tutorialwing@gmail.com.

In this post, we will go through Kotlin program to find quotient and remainder when dividend is divided by divisor.
In other words, we are going to find quotient and remainder when a number is divided by another number in kotlin.

## Kotlin program to find Quotient and Remainder

Sourcecode –

```import java.util.*

fun main() {

println("Enter dividend:")

println("Enter divisor:")

val quotient = dividend / divisor
val remainder = dividend % divisor

println("Quotient = \$quotient")
println("Remainder = \$remainder")
}
```

When you run the program, output will be

```Enter dividend:
25
Enter divisor:
3
Quotient = 8
Remainder = 1
```
###### Explanation:

At first, we are accepting two inputs (Dividend and Divisor) from user.
val dividend = read.nextInt() means read the value entered by user and store it in variable
dividend.

Similarly, we read the value(i.e. divisor) entered by user and stored it in divisor.

/ operator is used to get quotient when a number is divided by other number. So,
dividend / divisor will return quotient when dividend is divided by divisor.

% operator is used to get remainder when a number is divided by other number. So,
dividend % divisor will return remainder when dividend is divided by divisor.