## C Program To Find Remainder of Dividend and Divisor

Let us learn how to find Remainder of a Dividend and Divisor in C programming language. Here, we have demonstrated different ways of calculating the remainder of a number.

#### What is a Remainder?

A remainder is an integer that is achieved after dividing two integers with each other, producing a quotient too.

The remainder will get more clear from the below-given image. When you divide 11 by 3, you multiply 3 with 3 and the remainder becomes **2** since **(11 – (3*3)) = 2**.

#### Formula To Get Remainder

Dividend = Divisor × Quotient + Remainder

**Must Read: C Program To Find GCD of Two Integers**

#### Method 1: C Program To Find Remainder of Dividend and Divisor

1 2 3 4 5 6 7 8 9 10 11 12 13 | #include<stdio.h> int main() { int remainder, divisor, dividend; printf("\nEnter the Dividend:\t"); scanf("%d", ÷nd); printf("\nEnter the Divisor:\t"); scanf("%d", &divisor); remainder = dividend % divisor; printf("\nRemainder of the Number:\t%d\n", remainder); return 0; } |

#### Method 2: C Program To Calculate Remainder without using Modulus Operator

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | #include<stdio.h> int main() { int remainder, divisor, dividend; printf("\nEnter the Dividend:\t"); scanf("%d", ÷nd); printf("\nEnter the Divisor:\t"); scanf("%d", &divisor); remainder = dividend / divisor; remainder = remainder * divisor; divisor = dividend - remainder; printf("\nRemainder of the Number:\t%d\n", divisor); return 0; } |

#### Method 3: C Program To Get Remainder using Functions

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | #include<stdio.h> int find_remainder(int a, int b) { int remainder; remainder = a % b; return remainder; } int main() { int result, divisor, dividend; printf("\nEnter the Dividend:\t"); scanf("%d", ÷nd); printf("\nEnter the Divisor:\t"); scanf("%d", &divisor); result = find_remainder(dividend, divisor); printf("\nRemainder of the Number:\t%d\n", result); return 0; } |

**Must Read: C Program To Find Leap Year**

#### Output

In case you get any compilation errors or any doubts in this C program for calculating remainder of a number, let us know about it in the comment section below.

I was confused with Divisor and Dividend Numbers. Your image above has simplified to understand both of them. 🙂