#include <iostream>
using namespace std;
void increment(int *n){ //declare argument of the functon as pointer
*n+=1;
cout<<"In function: "<<*n<<endl;
}
int main()
{
int x=5;
increment(&x); //passing the address of the variable to the function
cout<<"In main: "<<x<<endl;
}