Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "pch.h"
- #include <iostream>
- #include <string>
- using namespace std;
- int main()
- {
- int number;
- cout << "Insert a number: ";
- cin >> number;
- for (int i = 1; i <= number; i++)
- {
- if (i > 0)
- {
- if (i==1 || i % 2 == 0 || i % 3 == 0 || i % 5 == 0) cout << i;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement