Find answers, ask questions, and connect with our <br>community around the world.

Tagged: 

  • AbdulKadir

    Member
    August 29, 2023 at 11:01 am

    And that question, Why ref = 20 variable affect the x?

    I dont understand.

     

    Could you explain please. Thanks.

    • Nishant

      Member
      August 30, 2023 at 10:13 am

      The variable ‘ref’ has been mistakenly typed in place of y. Thanks for pointing out the mistake. We will update it.

  • Nishant

    Member
    August 30, 2023 at 10:09 am

    In this program as one parameter is passed by value and other is passed by reference so after
    4 calls when c == 0, then the value of x = 7 and as x is passed by reference so all the changes will be reflected back in
    all the previous calls hence the answer 1*7*7*7 = 343

Log in to reply.

error: Content is protected !!