Untitled
#include <iostream> using namespace std; int main() { int a, b, c; cin >> a >> b; c = a; while (c >= a && c <= b) { int n = 1; for (int i = 2; i <= b; i++) { if (c > 1 && c % i == 0 && c != i) { n = 0; } } if (n > 0 && c != 1) cout << c << " "; c++; } }