- To find Quotient and Remainder
User Input:
Dividend : 7
Divisor : 5
Output:
Quotient : 1
Remainder : 2
import java.util.Scanner
fun main(args: Array<String>) {
print("Enter your dividend : ")
val userInput = Scanner(System.`in`)
var dividend:Int = userInput.nextInt()
print("Enter your divisor : ")
var divisor:Int =userInput.nextInt()
println("Quotient : "+ dividend/divisor)
println("Remainder : "+ dividend%divisor)
}
Enter your dividend : 7 Enter your divisor : 2 Quotient : 3 Remainder : 1Program
dividend / divisor // use devision( / ) operator to find quotient
dividend % divisor // use modulus( % ) operator to find remainder
modulus( % ) operator used to find remainder, & devision( / ) operator used to find quotient
ConceptComing Soon !
QuickThe dreams I chased took me on a journey, a journey more rewarding than the goals