C Program to Find Quotient and Remainder of Number

C Program to Find Quotient and Remainder of Number

Write C code to find quotient and remainder of the given number

//Write a program to find the quotient and remainder of the  numbers

#include<stdio.h>

int main()
{
    int dividend, divisor, quotient, remainder;

    printf("Enter the dividend number :--> ");
    scanf("%d", &dividend);

    printf("Enter the divisor number :--> ");
    scanf("%d", &divisor);

    quotient = dividend / divisor;

    remainder = dividend % divisor;

    printf("Quotient :--> %d\n", quotient);
    printf("Remainder :--> %d", remainder);

    return 0;
}

Output:

Enter the dividend number :--> 9
Enter the divisor number :--> 4

Quotient -->  2
Remainder :--> 1