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
My HTC Desire 510's mobile data stopped working, how to I make it work again?
denis-greek [22]
Ask your mobile operator
2.go to hrs service
3. Turn on and turn off
4 0
3 years ago
Entering the formula =SUM(C5:C18), in cell C19 will result in which of the following?
Greeley [361]
I am not sure what the 'following's are
but it should result the sum of all cells between and including C5 and C18.

5 0
3 years ago
Address Resolution Protocol (ARP) is a protocol for mapping an IP address to a physical machine address that is recognized in th
Nimfa-mama [501]

Answer: Switch

Explanation: ARP spoofing is a illegal harmful activity in a disguised manner by a person who tries to send the ARP (Address resolution protocol)request.The disguised ARP request is sent to steal the confidential data by the overloading of the switch because of the numerous amount of the ARP request. This attack is done in the local area network .Therefore, the correct option is switch.

6 0
3 years ago
Write a function which sorts the queue in order from the smallest value to the largest value. This should be a modified version
PilotLPTM [1.2K]

Answer:

#include <iostream>

using namespace std;

void swap(int *a,int *b){    //function to interchange values of 2 variables

   int temp=*a;

   *a=*b;

   *b=temp;

}

void sort(int queue[],int n)

{

   int i,j;

   for(i=0;i<n;i++)      //to implement bubble sort

   {

       for(j=0;j<n-i-1;j++)

       {

           if(queue[j]>queue[j+1])

               swap(queue[j],queue[j+1]);    //to swap values of these 2 variables

       }

   }

}

int main()

{

   int queue[]={6,4,2,9,5,1};

   int n=sizeof(queue)/4;  //to find length of array

   sort(queue,n);

   for(int i=0;i<n;i++)

       cout<<queue[i]<<" ";

   return 0;

}

OUTPUT :

1 2 4 5 6 9

Explanation:

In the above code, Queue is implemented using an array and then passed to a function sort, so that the queue can be sorted in ascending order. In the sort function, in each pass 2 adjacent values are compared and if lower index value is greater than the higher one they are swapped using a swap function that is created to interchange the values of 2 variables.

7 0
3 years ago
When responding to an incident in which explosive materials are suspected, is it safe to use wireless communication devices?
Nataly [62]

Answer:

No

Explanation:

Wireless communication devices like the cell phones transmits signals using radio or electromagnetic wave, which would trigger a bomb. An example of this kind of bomb is the home-made bomb also known as IED (improved explosive device).

The most common type of this IED is the radio controlled IED, which uses electromagnetic wave from a cell phone or a radio controlled type firing circuit. Insurgents, criminals etc, make use of such devices, since the materials are easy to get and are affordable.

8 0
3 years ago
Other questions:
  • 1.) How do parks and other green spaces benefit a community?
    7·2 answers
  • Wich is the correct process for selecting an entire row in a spreadsheet?
    12·1 answer
  • When creating a presentation you should use a blank as a starting point?
    15·1 answer
  • Help plzzzz_________ provide a means of organizing and summarizing data A. Reports B. Metadata C. Connectors D. All
    9·1 answer
  • When Twitter is used to gather a large group for a face-to-face meeting it is called
    10·1 answer
  • Why is it generally a good idea to set the font size to at least 30 points in presentations?
    6·2 answers
  • Element primer a partir del qual es generarà l'energia central solar fotovoltaica
    9·1 answer
  • Explain how communication facilitate cordination​
    14·1 answer
  • What is the difference between php and html?​
    13·2 answers
  • ____ the most popular word processing applications software<br><br>​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!