Answer:
4) 3 11 44
Explanation:
Given data
int [] val = { 3, 10, 44 };
The total number of parameters of given array are 3, so total length of array is also 3.
The indexing of array starts with '0', Therefore the indexes of array with length zero are: {0,1,2}
The value of array at index 0 is = 3
similarly,
value at index 1 = 10
value at index 2 = 44
Here, Int i = 1 is storing the value '1' in integer variable i.
In addition to that, any value of index 'i' of an array is selected using array[i].
Therefore,
val[i] is selecting the value of array located at index '1' because i = 1.
val[i] = val[1] = 10
val[i]+1 is selecting the value of array located at index 'i' that is (1) and adding 1 to it
=> val[i] = 10
=> val[i]+1 = 10+1 = 11
Finally,
val[i] = val[i]+1; is copying the val[i]+1 = 11 to value placed at index 1 (10). Hence, the output would be {3 11 44}. So 4th option is correct.
Answer:
The code to this question is "sendVariable(x);".
Explanation:
The explanation of the (method calling) code can be given as:
- In the question, it is defined that there is a method that name is "sendVariable()". In this method, we pass an integer variable that is "x".
- The variable x value is already declared and assigned and this variable is passed in the method.
- This method is defined in the same class so the code for calling this method is "sendVariable(x);".
Answer:
1. total=sum(k*k for k in range (1,51))
2. total=0
k=1
while k<=n:
total+=k**3
k+=1
Explanation:
Answer:
Check the explanation
Explanation:
public static void main(String[] args){
int[][] twoDimenArray = new int[2][];
//first row has 3 columns
twoDimenArray[0] = new int[3];
//second row has 4 columns
twoDimenArray[1] = new int[4];
int counter = 0;
//initializing array
for(int row=0; row < twoDimenArray.length; row++){
for(int col=0; col < twoDimenArray[row].length; col++){
twoDimenArray[row][col] = counter++;
}
}
//printing array
for(int row=0; row < twoDimenArray.length; row++){
System.out.println();
for(int col=0; col < twoDimenArray[row].length; col++){
System.out.print(twoDimenArray[row][col] + " ");
}
}
}
}
<u>Output
</u>
0 1 2
3 4 5 6
1. Imminent?
2. Copyright?