(Finding numbers divisible by 5 or 6 but not both) Write a program that displays, ten numbers pr line, all the numbers from 100 to 200 that are divisible by 5 or 6 but not both.
1
Expert's answer
2012-09-07T11:32:56-0400
#include <iostream> using namespace std;
int main(){ int k = 0; for (int i = 100 ; i < 200 ; i++){ & if (((i%5 == 0) || (i%6 == 0)) && !((i%5 == 0) && (i%6 == 0))) { & k++; & & cout<<i<<' ';
Comments
Leave a comment