Answer to Question #62135 in MatLAB | Mathematica | MathCAD | Maple for william
Determine the number of positive integers x, where x <100 and x is divisible by 2,3 or 5
1
2016-09-19T14:52:03-0400
#include <iostream>
int main() {
int count = 0;
for (int i = 1; i < 100; i++) {
if (i % 2 == 0 || i % 3 == 0 || i % 5 == 0) count++;
}
std::cout << count;
return 0;
}
Need a fast expert's response?
Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Comments
Leave a comment