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
What are some good editing software apps for pc?
Anettt [7]

Answer:

If you have the money, buy Adobe Premiere Pro and Adobe After Effects (which is usually used in post-production).

If you need free ones many websites say Filmora, OpenShot, and Lightworks but I've used Filmora before and it's alright.

6 0
3 years ago
20 points for ez question lol
slega [8]
I think it might be the third on not certain
5 0
3 years ago
Read 2 more answers
What is the Matrix? Should you take the blue or red pill?
Alexeev081 [22]

Answer:

THE RED PILL

Explanation:

6 0
3 years ago
Read 2 more answers
What is the number 232 in binary
Gnesinka [82]

Answer:

Step 1: Divide (232)x_{10} successively by 2 until the quotient is 0:

232/2 = 116, remainder is 0

116/2 = 58, remainder is 0

58/2 = 29, remainder is 0

29/2 = 14, remainder is 1

14/2 = 7, remainder is 0

7/2 = 3, remainder is 1

3/2 = 1, remainder is 1

1/2 = 0, remainder is 1

Step 2: Read from the bottom (MSB) to top (LSB) as 11101000.

So, 11101000 is the binary equivalent of decimal number 232

(Answer).

5 0
3 years ago
Read 2 more answers
Write a method that takes a RegularPolygon as a parameter, sets its number of sides to a random integer between 10 and 20 inclus
Sergio [31]

Answer:

import java.lang.Object

import java.lang.Math

public class RegularPolygon  extends java.lang.Object{

  public void randomize(RegularPolygon c){

       int min = 10, max1 = 20;

       double  min1 = 5, max1 = 12;

       double range = (max - min) + 1;

       double range1 = (max1 -min1) + 1

       int side = (Math.random() * range) + min;

       double len = (Math.random() * range1) + min1;

       c.setNumSides(side);

       c.setSideLength( len);

 }

 public static void main(String[] args) {

    RegularPolygon r = new RegularPloygon();

    randomize(r);

 }

}

Explanation:

The randomize method accepts a regular polygon class as its only parameter and assigns a random number of sides and the length of these sides with the 'Math.random' function.

5 0
3 years ago
Other questions:
  • An engineer is assigned the task of reducing the air pollutants being released from a power plant that generates electricity by
    9·1 answer
  • Write a program to read-in a sequence of integers from the keyboard using scanf(). Your program will determine (a) the largest i
    8·1 answer
  • How do you recognize the brand name of a drug in the package insert?
    15·1 answer
  • The range A2:B4 has how many cells?   A. 2   B. 4   C. 6   D. 8
    11·2 answers
  • What is the location in the base interface of the link to
    7·1 answer
  • Yo, my Lenovo laptop keeps showing this screen but I can't sign in, can someone help me?
    5·2 answers
  • Match the elements used in web searches to their functions.
    12·1 answer
  • X = 9 % 2<br><br> if (x == 1):<br>   print ("ONE")<br> else:<br>   print ("TWO")
    5·2 answers
  • Please can someone solve this question<br>What is a software and types of software​
    11·1 answer
  • A(n) ______is like an intranet except it shares its resources with users from a distant location. Select your answer, then click
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!