English

What Are the Values of a and B After the Following Function is Executed, If the Values Passed Are 30 and 50: - Computer Applications

Advertisements
Advertisements

Question

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); 
} 
One Line Answer

Solution

The value of a will be 50 and b will be 30. 

shaalaa.com
Introduction of Values and Data Types
  Is there an error in this question or solution?
Chapter 5: User - Defined Methods - Review Insight [Page 333]

APPEARS IN

Avichal Computer Applications [English] Class 10 ICSE
Chapter 5 User - Defined Methods
Review Insight | Q 10. | Page 333
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×