With a little digging I've done, finding this question with different answers the one you want is D. none of the above
Answer:
public class print{
public static void fillArray(int[] arr, int initialValue){
int n = arr.length;
for(int i=0;i<n;i++){
arr[i] = initialValue++;
}
for(int i=0;i<n;i++){
System.out.print(arr[i]+" ");
}
}
public static void main(String []args){
int[] array = new int[5];
int initialValue =3;
fillArray(array,initialValue);
}
}
Explanation:
Create the function with two parameter first is array and second is integer.
Then, declare the variable and store the size of array.
Take the for and fill the array from the incremented value of initialValue by 1 at every run of loop.
After loop, print the element of the array.
Create the main function which is used for calling the function and also declare the array with size 5 and initialValue with 3. After that, call the function with this argument.
1. Cyberbullying
2.Confide in an adult you trust, such as a teacher or a parent
3.It is easy to miscommunicate and escalate the situation in an online environment
Cyberbully hurts people, so NEVER post something that could hurt someone's feelings
Hope this helps!
Answer:
This is what the code should do:
“Lift off in T minus
5
4
3
2
1
Blast-off!”
When I run it, it just keeps printing ''Sum = 5'' forever.
Explanation:
Code:
int main(void) {
int sum = 5;
int i;
printf("Lift off in T minus\n");
for (i = 0; i < 5; i=i+i) {
sum = sum - i;
printf("sum = %d\n",sum);
}
printf("Blast-off",sum);
return 0;