C Language

May 22, 2023

How to use quotient and remainder in c language

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

by : Ajaj Khan

Quick Summary:

Quotient and remainder are coming out in this program