All you need to do here is to changes the lines order.
#include <iostream>
using namespace std;
int main()
{
int userNum;
cout<<“Enter a number”<<endl;
cin >> userNum;
if (userNum > 0){
cout << “Positive.” << endl;
}
else{
cout << “Not positive, converting to 1.” << endl;
userNum=1;
}
cout<<“Final: “<<userNum<<endl;
return 0;
}