1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Serjik [45]
3 years ago
9

Suppose that sales is a two-dimensional array of 10 rows and 7 columns wherein each component is of the type int , and sum and j

are int variables. Which of the following correctly finds the sum of the elements of the fifth row of sales?1. sum = 0;for(j = 0; j < 10; j++)sum = sum + sales[5][j];2. sum = 0;for(j = 0; j < 7; j++)sum = sum + sales[4][j];3. sum = 0;for(j = 0; j < 10; j++)sum = sum + sales[4][j];4. sum = 0;for(j = 0; j < 7; j++)sum = sum + sales[5][j];
Computers and Technology
1 answer:
Deffense [45]3 years ago
3 0

According to the given question, sales is a two-dimensional array and contains 10 rows and 7 columns wherein each component is of type integer and the variables sum and j are also of integer type.

<u>Explanation:</u>

In order to find the sum of the elements of the fifth row of sales, the correct piece of code should be:

sum=0;

for(j=0;j<7;j++)

sum=sum+sales[4][j];  

The indexing in an array always starts from zero, therefore, to calculate the sum of the fifth row, the user has to write 4 in the index to point to the fifth row.

You might be interested in
What is the process called when programmers look for and fix errors in code? Analysis Debug Document Error check
Sunny_sXe [5.5K]
It’s Debug. definition: “identify and remove errors from (computer hardware or software)”.
4 0
3 years ago
Read 2 more answers
What is an example of fibre optic cable<br>​
Arte-miy333 [17]

Answer:

printing cable

Explanation:

is a cable used to transfer information from a computer to the printer in packages

5 0
2 years ago
The science of networking is attributed to which government's involvement?
worty [1.4K]

Answer:

The United States

if I am not mistaken

6 0
2 years ago
Which of the following is a good choice to help you stay organized when you are away from the office? A. Personal Information ma
Free_Kalibri [48]

Answer:

A

Explanation:

6 0
3 years ago
Marcus creates a HTML webpage on his favourite game, football. On clicking the word “football” another website containing the in
igomit [66]

please mark me as the brainlest answer please

if you do it then I will answer your all questions.

4 0
2 years ago
Other questions:
  • Which of the following is applicable during a hostile act:
    15·1 answer
  • Many companies use software to scan resumes and search for _____________.
    10·1 answer
  • What is a series of instructions or commands that a computer follows used to create software
    9·1 answer
  • What do economists call a decline in the real GDP combined with a temporary rise in price level?
    8·2 answers
  • What is the first computer ever made?????
    9·2 answers
  • Write a program that uses two input statements to get two words as input. Then, print the words on one line separated by a space
    11·1 answer
  • Develop a C program that calculates the final score and the average score for a student from his/her (1)class participation, (2)
    9·1 answer
  • Suppose we wanted to make change for purchases and wanted to use the least number of coins possible. Here is a greedy algorithm:
    5·1 answer
  • What is the difference between second generation and third generation​
    15·1 answer
  • _____ allows a function or operator to perform different tasks depending on the types of the arguments or operands. Group of ans
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!