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
vlabodo [156]
3 years ago
12

C - Language Write three statements to print the first three elements of array runTimes. Follow each statement with a newline. E

x: If runTimes[5] = {800, 775, 790, 805, 808}, print: 800 775 790#include int main(void) {const int NUM_ELEMENTS = 5;int runTimes[NUM_ELEMENTS];int i;for (i = 0; i < NUM_ELEMENTS; ++i) {scanf("%d", &(runTimes[i])); }/* Your solution goes here */
return 0;}
Computers and Technology
1 answer:
Jobisdone [24]3 years ago
8 0

Answer:

Replace

/* Your solution goes here */

with

printf("%d",runTimes[0]);

printf("%d",runTimes[1]);

printf("%d",runTimes[2]);

Explanation:

The question requires that the first three elements of array runTimes be printed;

The first three elements are the elements at the first, second and third positions.

It should be noted the index of an array starts at 0;

  • So, the first element has 0 as its index
  • The second has 1 as its index
  • The third has 2 as its index

So, to make reference to the first three elements, we make use of

<em>runTimes[0], runTimes[1] and runTimes[2]</em> respectively

Having mention the above;

It should also be noted that array is of type integers;

So, to display integers in C, we make use of "%d";

Hence, the print statement for the first three elements is

printf("%d",runTimes[0]);

printf("%d",runTimes[1]);

printf("%d",runTimes[2]);

You might be interested in
Which of these allows the programmer to put data inside a variable?
gregori [183]

Answer:

it's the equal sign "="

5 0
2 years ago
: how can you reduce file size so that files can be sent more efficiently across the internet
Rina8888 [55]
You can compress them. ZIP is the most well known protocol.
8 0
2 years ago
This is the recorded history of the development of a group functioning within an organization. Identify the sentence that refers
Vikentia [17]
This is the recorded history of the development of a group functioning within an organization. Identify the sentence that refers to the norming stage of group development.

. The group then created a working structure that everyone agreed with.

5 0
3 years ago
Read 2 more answers
Symbols can enhance your text. You can add mathematical or currency symbols, geometric shapes, and even smiley faces. Under whic
Sliva [168]
The answer is D. Hope this helped.
4 0
2 years ago
Why do some people have random numbers as their usernames?
Angelina_Jolie [31]
Mostly for privacy or to not get caught looking up answers probably
3 0
2 years ago
Read 2 more answers
Other questions:
  • After you enter the details for the first selected recipient in the New Address List dialog box, click _______ to add another re
    11·2 answers
  • Pendant Publishing edits multi-volume manuscripts for many authors. For each volume, they want a label that contains the author'
    14·1 answer
  • Question: A famous Disney Movie partially takes place in this city.
    15·2 answers
  • Write a function wordcount() that takes the name of a text file as input and prints the number of occurrences of every word in t
    12·1 answer
  • What is the accounting equation?
    12·1 answer
  • Which of the following is NOT a benefit of safety and health programs?
    11·1 answer
  • Create a datafile called superheroes.dat using any text-based editor, and enter at least three records storing superheroes’ name
    9·1 answer
  • write a pay-raise program that requests a person's first name, last name, and current annual salary, and then displays the perso
    6·1 answer
  • What is media ethics. Explain two forms of maintaining media ethics with examples​
    13·1 answer
  • Bryan's company is new and has limited funds to work with. He has been tasked with finding a telecommunications technology that
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!