Computer Applications

What are the values of a and b after the following function is executed, if the values passed are 30 and 50:

void paws(int a, int b)
{
    a=a+b;
    b=a–b;
    a=a–b;
    System.out.println(a+ "," +b);
}

User Defined Methods

ICSE 2015

24 Likes

Answer

Value of a is 50 and b is 30.
Output of the code is:

50,30

Answered By

12 Likes


Related Questions