The user enters the following code. What will be the value of
total after the code is executed?
val1 = 4;
val3 = 20;
total = sum(val1,val3);
1
Expert's answer
2016-04-20T11:26:04-0400
package com.company;
public class Main { static int sum(int a, int b) { int total; total = a + b; return total; } public static void main(String[] args) { int val1 = 4; int val3 = 20; int total = sum(val1,val3); System.out.println("Total = " + total); } }
Comments
Leave a comment