C++ Programming Blog

 
 
 
# include <iostream.h>
# include <conio.h>

int main()
{
    clrscr();
    int i,j;
    void change(int &,int &);
    cout<<\"\\nENTER THE VALUE FOR THE FIRST VARIABLE:->\";
    cin>>i;
    cout<<\"\\nENTER THE VALUE FOR THE SECOND VARIABLE:->\";
    cin>>j;
    change(i,j);
    cout<<\"\\nTHE CHANGED FIRST VALUE IS :->\"<<i;
    cout<<\"\\nTHE CHANGED SECOND VALUE IS :->\"<<j;
    getch();
    return 0;
}

void change(int &i,int &j)
{
    i=i+10;
    j=j+10;
}

 
 
Didn't find what you were looking for? Find more on FUNCTION WITH ALIAS NAME OR REFERENCE VARIABLE IN C++