Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Selected Reading
Number is divisible by 29 or not in C++
It's a straightforward problem. We can use the modulo (%) operator to check whether the given number is divisible by 29 or not. Let's see some examples.
Input
29 254
Output
1 0
Algorithm
Implementation
Following is the implementation of the above algorithm in C++
#includeusing namespace std; bool isDivisibleBy29(long long n) { return n % 29 == 0; } int main() { cout Output
If you run the above code, then you will get the following result.
1 1 0
Advertisements
