C Program to find quotient without using division operator


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


2 = 10 / 5

0 = 5 / 10


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

Run it Now
#include<stdio.h>

int main() {

   int a, b, c = 0;

   printf("Enter Two Numbers :");
   scanf("%d%d", &a, &b);

   while (a >= b) {
       a = a - b;
       c++;
   }

   printf("\nThe Quotient is :%d", c);
   return 0;
}

Output:

Enter Two Numbers :9 3
The Quotient is :3