# C++ Program to find remainder without using the modulus operator

In this program, You will learn how to find the remainder without using the modulus operator in C++.

```
0 = 10 % 5
5 = 5 % 10
```

## Example: How to find the remainder without using the modulus operator in C++.

```
#include<iostream>
using namespace std;
int main() {
int a, b;
cout << "Enter first number:";
cin >> a;
cout << "Enter second number:";
cin>>b;
while (a >= b) {
a = a - b;
}
cout << "Remainder is:" << a;
return 0;
}
```

#### Output:

```
Enter first number:12
Enter second number:5
Remainder is:2
```