Answer:
C++.
Step-by-step explanation:
#include <iostream>
using namespace std;
////////////////////////////////////////////////////////////////
void printPrime(int n) {
if (n > 0) {
cout<<2<<endl;
for (int i=3; i<=n; i++) {
bool isPrime = true;
for (int j=2; j<i; j++) {
if (i % j == 0) {
isPrime = false;
break;
}
}
if (isPrime == true)
cout<<i<<endl;
}
}
else {
cout<<"Invalid input";
}
}
int main() {
int n;
cout<<"Enter positive integer: ";
cin>>n;
printPrime(n);
return 0;
}