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 the following is ture?
serious [3.7K]

answer: if a list needs to be updated, the entire program must be rewritten.

5 0
2 years ago
Public relations strives to foster goodwill between a client and a audience ​
DENIUS [597]

Answer:

The Statement is True.

Explanation:

Public Relations is the term referred to simply building of relations with the public. The strength of the relation describes how strong or weak is the relation of an individual or an organization with the general public. There could be good or poor public relations. Good Public relations are the intangible assets of a company. The statement written in the question tells us about this intangible assets gaining. Public relations strives to foster goodwill between a client and audience. There is always a relation between the company and the consumers’ of company’s product. Here client is considered as the Company and audience is considered as the consumer of the company’s product. So public relations is a way to promote goodwill between the client and the audience. Good public relations will create satisfied customers that would play a part in fostering the goodwill of the company. So there is a direct relation between the good public relations and goodwill of the company.  

3 0
3 years ago
Write a Tip Calculator in code in VMware Fusion
lisabon 2012 [21]

final \: amount \times percent \: of \: tip = tip \: amount
7 0
3 years ago
A wireless (radio) transmission of data can only travel a short distance.<br><br> True or false?
timofeeve [1]

I believe this is false as some radio waves can travel beyond our solar system

7 0
3 years ago
Write a program for Horizon Phones, a provider of cellular phone service. Prompt a user for maximum monthly values for talk minu
Anarel [89]

Answer:

mport java.util.Scanner;

public class CellPhoneService

{

    public static void main (String args[])

    {

         Scanner sc=new Scanner(System.in);

         System.out.println("Enter the Talk minutes");

         int talkmin=sc.nextInt();

         System.out.println("Enter the text message");

         int textmsg=sc.nextInt();

         System.out.println("Enter the Gigabyte Data");

         int gbdata=sc.nextInt();

         if(talkmin<500 && textmsg==0 && gbdata==0)

         System.out.println("PLAN A IS RECOMMENDED FOR THIS USER at 49$ per month");

         else if(talkmin<500 && textmsg>0 && gbdata==0)

         {

              System.out.println("PLAN B IS RECOMMENDED FOR THIS USER at 55$ permonth");

         }

         else if(talkmin>=500 && textmsg<100 && gbdata==0)

         {

              System.out.println("PLAN C IS RECOMMENDED FOR THIS USER at 61$ permonth");

         }

         else if(talkmin>=500 && textmsg>=100 && gbdata==0)

         {

              System.out.println("PLAN D IS RECOMMENDED FOR THIS USER at 70$ permonth");

         }

         else if(gbdata>0 && gbdata<2)

         {

              System.out.println("PLAN E IS RECOMMENDED FOR THIS USER at 79$ permonth");

         }

         else if(gbdata>=2)

         {

              System.out.println("PLAN F IS RECOMMENDED FOR THIS USER at 87$ permonth");

         }

    }

}

Explanation:

  • Take the talk minute and text message as input from user.  
  • Apply the conditional statement to check if talk minute is less than 500 along with text message and GB data having a value 0.
  • At last check if GB data is greater than or equal to 2, then print the relevant response.
3 0
3 years ago
Other questions:
  • type the correct answer in the Box spell the words correctly Caleb is working on a simple logic base program to stimulate the ga
    5·2 answers
  • ________ is the abbreviation for the place in the computer where the programs and data the computer is currently using are store
    8·1 answer
  • which of the following is involved in ordering an outline. A.grouping B.merging C.organizing D.arranging
    10·1 answer
  • Chunking is a good strategy for completing large assignments because it makes the work
    7·2 answers
  • One of the best ways to shoot a picture is to frame the subject in the middle of the screen or viewer. T or F
    14·2 answers
  • Select the correct answer.
    7·2 answers
  • Describe a cellular network, its principle<br> components and how it works.
    7·1 answer
  • What are hardware and software?<br><br><br><br> WILL MARK BRAINIEST
    9·2 answers
  • Which version of HTML provides the lowest common denominator of HTML tags
    8·1 answer
  • Which of the following is not a reason to choose a community college?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!