Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int multipli_3(int a, int b) {
- int m = 0;
- for(int i = a; i <= b; i++) {
- if(i % 3 == 0) m ++;
- }
- return m;
- }
- int main() {
- int a, b;
- cout << "Inserire a, b: ";
- cin >> a >> b;
- cout << "Numero mutipli di 3 nell'intervallo a, b: " << multipli_3(a, b);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement