R Program to find quotient without using the division operator


In this program, You will learn how to find quotient without using division operator in R.


4 / 5 = 0.8

as.integer(4 / 5) = 0

Example: How to find quotient without using division operator in R

{
    x <- as.integer(readline(prompt = "Enter first number :"))
    y <- as.integer(readline(prompt = "Enter second number :"))

    c = 0

    while (x >= y) {
      x = x - y

      c = c + 1
    }
    print(paste("Quotient is :", c))

}

Output:

Enter first number :4
Enter second number :2
[1] "Quotient is : 2"