diff --git a/chapter_1/exercise/R_1_8.cpp b/chapter_1/exercise/R_1_8.cpp new file mode 100644 index 0000000..87ad340 --- /dev/null +++ b/chapter_1/exercise/R_1_8.cpp @@ -0,0 +1,27 @@ +#include +using namespace std; + +bool isMultiple(int num1, int num2) { + if (num1 % num2 == 0) { + return true; + } + return false; + +} + +//Program to test the function. +int main() { + int num1; + int num2; + + cout << "Enter a whole number: "; + cin >> num1; + + cout << "Enter another whole number: "; + cin >> num2; + + bool value = isMultiple(num1, num2); + cout << value; + + return 0; +}