while(n>10 || n<1)//taking input if the number is not within range..
{
cout<<"Enter the number again"<<endl;
cin>>n;
}
activity(n);//calling activity with the n..
}
return 0;
}
Explanation:
Above written is the main function in which a prompting an integer between 1 and 10 if it is not within range then again taking input.Then after that calling activity with n as argument.