Write a program that accepts an upper limit from the user and it should display the following series up-to the upper limit specified in a n variable. 1 3 9 27 81…………………n

#include<iostream>
using namespace std;
int main()
{
int upper_Limit=0,i;
cout<<“Enter the upper Limit: “;
cin>>upper_Limit;
int multiple=1;
for(i=0;i<upper_Limit;i++)
{

if(multiple<=upper_Limit)
{
cout<<multiple<<“\t”;
multiple=multiple*3;
}

}
}