Write a program that reports whether a number input is divisible by
7. (Hint: If a number is divisible by 7, that means you can divide it by 7 and get a remainder of 0.)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#include <iostream>
usingnamespace std;
int main() {
int n;
cout << "Enter the number you wish to divide by 7";
cin >> n;
if ( n % 7 == 0 )
cout << " The number is divisible by 7.";
else
cout << " The number is not divisible by 7.";
return 0;
}