How to use quotient and remainder in c language

Quotient and Remainder

On this page

Quotient and Remainder

Program to use Quotient and Remainder in c language

#include<stdio.h>
  int main()
  {
    int x,y,quo,rem;
    printf("Enter two number : ");
    scanf("%d%d",&x, &y);
    if(y)
    {
        quo = x/y;
        rem = x%y;
        printf("quotient = %d, remainder = %d\n",quo,rem);
    }
    else 
    printf("divide by zero error\n");
    return 0;
  }
  

Output

Enter two number : 65
  5
  quotient = 13, remainder = 0