public static void main(String[] args) {
int c = 9;
int d = 11;
int bob = add(c, d);
bob = add(bob, 20);
}
public static int add(int a, int b){
return a+b;
For the above code, what is the value of bob at the end of the main function?
Programming Question
Create a function that changes the array values by adding the previous element to it.
Example: {1, 2, 3} --> {1, 3, 6}