Question: What will be the output when the following code segment is executed? public static void main(String[] arg) { int a 3, b=2, x =
What will be the output when the following code segment is executed? public static void main(String[] arg) { int a 3, b=2, x = 0, y = 5; System.out.println("before function call a, b, x, y are"+a+"\t"+b+"\t" +x+ "\t"+ y\ a = mixnumber(a,b y = mixnumber(x,y); System.out.println("before function call a, b, x, y are"+a+ "\t" + b + "\t" + x + "\t" + y); } int mixnumber(int x, int y) { if(xy) return y; else return x; }
Step by Step Solution
There are 3 Steps involved in it
Given Code public class Main public static void mainString args int a 3 b 2 x 0 y 5 Systemout... View full answer
Get step-by-step solutions from verified subject matter experts
