# Number is divisible by 29 or not in C++

C++Server Side ProgrammingProgramming

In this tutorial, we are going to write a program that finds whether the given number is divisible by 29 or not.

It's a straightforward problem. We can use the modulo (%) operator to check whether the given number is divisible by 29 or not.

## Example

Let's see the code.

Live Demo

#include <bits/stdc++.h>
using namespace std;
bool isDivisibleBy29(long long n) {
return n % 29 == 0;
}
int main() {
cout << isDivisibleBy29(29) << endl;
cout << isDivisibleBy29(234567876543) << endl;
cout << isDivisibleBy29(234567657329) << endl;
return 0;
}

## Output

If you run the above code, then you will get the following result.

1
1
0

## Conclusion

If you have any queries in the tutorial, mention them in the comment section.

Published on 03-Jul-2021 04:44:56