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
horsena [70]
3 years ago
5

Write an application that stores the following nine integers in an array: 10, 15, 19, 23, 26, 29, 31, 34, 38. Display the intege

rs from first to last, and then display the integers from last to first.
Computers and Technology
1 answer:
daser333 [38]3 years ago
7 0

Answer:

Following are the code to this question:

#include <iostream>// header file

using namespace std;

int main()//main method

{

int arr1[]= {10, 15, 19, 23, 26, 29, 31, 34, 38};//defining array of integer values

int i;//defining integer variable

cout<<" Array from first to last: ";//print message

for(i=0;i<9;i++)//use for loop to print array

{

cout<<arr1[i]<<" ";//print array value

}

cout<<"\n Array from last to first : ";//print message

for(i=9-1;i>=0;i--)//defining for loop to print array in reverse order

{

cout<<arr1[i]<<" ";//print array

}

return 0;

}

Output:

Array from first to last: 10 15 19 23 26 29 31 34 38  

Array from last to first : 38 34 31 29 26 23 19 15 10  

Explanation:

In the above-given code, an array "arr1" of an integer value is declared, that stores 9 elements, in the next step, an integer variable i is declared, that uses two for loop to print the value in the given order.

  • In the first for loop, it starts from 0 and ends when its value less than 9, and prints the array value.
  • In the second for loop, it starts from 9 and ends when the index value equal to 0, and prints the array value in reverse order.
You might be interested in
1. What is the central idea of the section "Service Record." Use two text details to
Vladimir [108]

Answer:

Service record is the record that is used to track the record of service of the employ in an organization.

Explanation:

The idea behind the service record is to maintain the whole detail of record of the person during his employment including, personnel information,  record related to his promotions and posting, salary record etc.

8 0
3 years ago
Bukod sa nakasulat na impormasyon ay makakakita rin ng larawan sa internet.​
faltersainse [42]

i woud love to help but i dont understand the language

7 0
2 years ago
A company operates on two types of servers: 2 large servers (L) and 4 smaller servers (S), with a combined total of 64GB RAM. Th
kati45 [8]

Explanation:

Let the size of a large server be L, and

the size of a small server be S.

We are given two scenarios,

2L+4S = 64.............(1)

and

L+3S = 40...............(2)

We solve the equations as follows

2(2)-(1)

2L-2L +6S-4S = 2*40-64

2S = 16

so S=8 ..................(3), size of small server

substitute (3) in (2)

L+3(8) =40

L = 40-24 = 16..............size of large server

8 0
3 years ago
Type the correct answer in the box. Spell all words correctly.
trasher [3.6K]

syntax are programming languages that specify a series of structured functions. C is an example of such a language.

7 0
3 years ago
Suppose you are provided with 2 strings to your program. Your task is to join the strings together so you get a single string wi
Mariulka [41]

Answer:

public class TestImport{

   public static void main(String[] args) {

       String string1 = args[1];

       String string2 = args[2];

       System.out.println(string1 +" " +string2);

   }

}

Explanation:

The solution here is to use string concatenation as has been used in this statement System.out.println(string1 +" " +string2);

When this code is run from the command line and passed atleast three command line arguments for index 0,1,2 respectively, the print statment will return the second string (that is index1) and the third argument(that is index2) with a space in-between the two string.

6 0
2 years ago
Other questions:
  • Suppose a worker needs to process 100 items. the time to process each item is exponentially distributed with a mean of 2 minutes
    5·1 answer
  • The first time you start Outlook on a home computer, the ____ feature guides you to provide information that Outlook needs to se
    11·1 answer
  • Additional chemical hazards training must be provided to employees:
    12·1 answer
  • If we can lock a file, we can solve the race condition problem by locking a file during the check-and-use window, because no oth
    14·1 answer
  • How does voting help in a social news site?
    10·1 answer
  • Int a = 1; int b = 0; int c = -1; if ((b + 1) == a) { b++; c += b; } if (c == a) { a--; b = 4; }
    7·1 answer
  • The __________ operator increases the value of the variable by 1 after the original value is used in the expression in which the
    7·1 answer
  • fun fact about London(me): when it comes to relationships she becomes clingy to the person shes dating
    10·1 answer
  • What is computer assisted translation​
    9·1 answer
  • According to the video, which tasks do Police Patrol Officers perform? Select all that apply.
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!