In this program, You will learn how to find quotient without using division operator in R.
Example: How to find quotient without using division operator in R
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
{ 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:
1 2 3 4 5 |
Enter first number :4 Enter second number :2 [1] "Quotient is : 2" |