Question

int maxScores[4] = {20, 20, 100, 50};. What is maxScores[3]?

int maxScores[4] = {20, 20, 100, 50};. What is maxScores[3]?

Homework Answers

Answer #1

The solution of the given problem is below:

The value of maxScores[3] will be 50.

Explanation-- This is an array problem. here array name is maxScores having size 4 ,it means the array maxScores will store the four integers value. in programming the value of array is acessing through subscript (index). we can acess the element in array directly by using index value like if i want to acess the element at position 2 then we have to write arrayname[2]. in the same way maxScores[3] will print the value at position 4 which is 50 because the index has been done from 0. Maxsxore[3] means value of an array at position 4 because index is from 0 (0,1,2,3).

here is screenshot of the executed code in which u can see result when the above code complies.

Please upvot in case of any query comment me.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
(This for java) Have to find the value of z int y= 3; int z =4;...
(This for java) Have to find the value of z int y= 3; int z =4; switch (y+4) {    case 6: z=2; break;    case 7: z=3; break; default: z+=5; }
1. public int add100(int[] array) { if (array.length < 100) { return 0; } int sum...
1. public int add100(int[] array) { if (array.length < 100) { return 0; } int sum = 0; for (int i = 0; i < 100; i++) { sum += array[i]; } return sum; } 2. int sum = 0; for (int i = 1; i <= n; i++) { for (int j = 0; j <= i; j++) { sum++; sum++; } } for (int i = 0; i < n; i += 2) { sum++; } 3. nt...
JAVA programming language: What is the output? for (int i = 0; i < 3; i++)...
JAVA programming language: What is the output? for (int i = 0; i < 3; i++) { for (int j = 0; j < 8; j++) { if (j>= 2) { break: } System.out.print("" + i + j + " "); } } Select one: a) 00 11 22 00 11 22 b) 00 01 10 11 20 21 c) 012 123 234 d) 000 001 100 110 200 210
create case 4 #include <stdio.h> int main(void) { int counter; int choice; FILE *fp; char item[100];...
create case 4 #include <stdio.h> int main(void) { int counter; int choice; FILE *fp; char item[100]; while(1) { printf("Welcome to my shopping list\n\n"); printf("Main Menu:\n"); printf("1. Add to list\n"); printf("2. Print List\n"); printf("3. Delete List\n"); printf("4. Remove an item from the List\n"); printf("5. Exit\n\n"); scanf("%i", &choice); switch(choice) { case 1: //add to list //get the input from the user printf("Enter item: "); scanf("%s", item); //open the file fp = fopen("list.txt","a"); //write to the file fprintf(fp, "\n%s", item); //close the file...
class Ex1{ 2. public static void main(String args[]){ 3. int x = 10; 4. int y...
class Ex1{ 2. public static void main(String args[]){ 3. int x = 10; 4. int y = new Ex1().change(x); 5. System.out.print(x+y); 6. } 7. int change(int x){ 8. x=12; 9. return x; 10. } 11. } Can you please explain this entire code and what is happening?
Q1: Given the following code, what is returned by tq(4)? int tq(int num){ if (num ==...
Q1: Given the following code, what is returned by tq(4)? int tq(int num){ if (num == 0) return 0; else if (num > 100) return -1; else     return num + tq( num – 1 ); } Group of answer choices: 0 4 -1 10 Q2: Given that values is of type LLNode<Integer> and references a linked list (non-empty) of Integer objects, what does the following code do if invoked as mystery(values)? int mystery(LLNode<Integer> list) {    if (list.getLink() ==...
3. What will be the value of w after the following section of code executes: int...
3. What will be the value of w after the following section of code executes: int w = 4, q = 3; if (q > 5)       if (w == 7)           w == 3;       else            if (w > 3)               w = 1;            else               w = 0; A.0            B.1              C.2          D.3 4. What will be the value of b after the following section of code executes: int a = 4, b = 0; if (a...
Consider the following array: int[] a = { 3, 5, 2, 2, 4, 7, 0, 8,...
Consider the following array: int[] a = { 3, 5, 2, 2, 4, 7, 0, 8, 9, 4 }; What are the contents of the array a after the following loops complete? (show how you arrive at the answer) a) for (int i = 1; i < 10; i++) { a[i] = a[i - 1]; b) for (int i = 9; i > 0; i--) { a[i] = a[i - 1]; }
int main() { int i, j, sum = 0; for(i=0;i<3;i++) { for(j=0;j<4;j++) { if(j > 2)...
int main() { int i, j, sum = 0; for(i=0;i<3;i++) { for(j=0;j<4;j++) { if(j > 2) break; sum++; } } } What is value of sum, explain.
\int \frac{x^4-6x-12}/{x^3-4x}dx
\int \frac{x^4-6x-12}/{x^3-4x}dx