C Program to Compute Quotient and Remainder

Compute Quotient Remainder

This program evaluates and Compute Quotient Remainder when an integer is divided by another integer.

To understand this Program to Compute Quotient Remainder, you should have the knowledge of following C programming topics:

Program to Compute Quotient and Remainder

#include <stdio.h>

int main()
	int dividend, divisor;
	int quotient, remainder;
	printf("Enter dividend: ");

	printf("Enter divisor: ");
        // Computes quotient 
	quotient= dividend/divisor;

        // Computes remainder
	remainder= dividend%divisor;
	printf("quotient: %d, remainder: %d\n",quotient,remainder);
	return 0;


Enter dividend: 25
Enter divisor: 4
Quotient = 6
Remainder = 1

C Program to Compute Quotient and Remainder

In this program, the user is asked to enter two integers (dividend and divisor) which are stored in variable dividend and divisor respectively.

Then the quotient is evaluated using division/operator and stored in the variable quotient.

Similarly, the remainder is evaluated using modulus % operator and stored in remainder variable.

Finally, the quotient and remainder are displayed using printf() function.

Related C Programs

Ask your questions and clarify your/others doubts on C Program to Compute Quotient and Remainder by commenting. Documentation