C Program to find quotient and remainder


In this program, You will learn how to find quotient and remainder in C.


2 = 10 / 5

0 = 10 % 5


Example: How to find quotient and remainder in C

Run it Now
#include<stdio.h>

int main() {

   int a, b, q, r;

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

   q = a / b;
   r = a % b;

   printf("\nQuotient is :%d", q);
   printf("\nRemainder is :%d", r);

   return 0;
}

Output:

Enter Two Numbers :9 2
Quotient is :4
Remainder is :1