jeudi 3 novembre 2022

How the value of m is 7?

I couldn't understand how the value of m=7 after execution of program.

void test(int m , int &n)
{
    n=n-2*m;
    m=2*m;
}


int main()
{
    int a=7, b=12;
    test(a,b);
    
   cout << a<<b;
   
   return 0;
}

Aucun commentaire:

Enregistrer un commentaire