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
lana [24]
2 years ago
11

Read integers from input and store each integer into a vector until -1 is read. Do not store -1 into the vector. Then, output al

l values in the vector (except the last value) with the last value in the vector subtracted from each value. Output each value on a new line. Ex: If the input is -46 66 76 9 -1, the output is:
-55
57
67
Computers and Technology
1 answer:
weqwewe [10]2 years ago
6 0

Answer:

The program in C++ is as follows:

#include <iostream>

#include <vector>

using namespace std;

int main(){

vector<int> nums;

int num;

cin>>num;

while(num != -1){

 nums.push_back(num);

 cin>>num; }  

for (auto i = nums.begin(); i != nums.end(); ++i){

    cout << *i <<endl; }

return 0;

}

Explanation:

This declares the vector

vector<int> nums;

This declares an integer variable for each input

int num;

This gets the first input

cin>>num;

This loop is repeated until user enters -1

while(num != -1){

Saves user input into the vector

 nums.push_back(num);

Get another input from the user

 cin>>num; }

The following iteration print the vector elements

<em> for (auto i = nums.begin(); i != nums.end(); ++i){ </em>

<em>     cout << *i <<endl; } </em>

You might be interested in
Why do people on Brainly verify answers that are wrong. I got 90% and 80% percent on my tests because of it
Bezzdna [24]
I feel that, you can’t trust it.
3 0
3 years ago
Read 2 more answers
Files exist on ____ storage devices, such as hard disks, dvds, usb drives, and reels of magnetic tape.
Verdich [7]
<span>Files exist on data storage devices, such as hard disks, DVDs, USB drives, and reels of magnetic tape.
</span>Data storage<span> is the recording (storing) of information (data) and </span><span>these data storage devices use</span> a technology consisting of computer components and recording media used to retain digital data.DVDs, USBs and hard disks are examples for external data storage devices.
8 0
3 years ago
When should you create an outline?
DIA [1.3K]

Answer:

hope you like it

Explanation:

Writing an outline can take place at any time during the writing process. Although it is most commonly used before beginning to write or doing research, this process can also take place during or after writing your paper to make sure your points are organized and make sense.

An outline is a first step for writing: a general, unfinished plan that you will use as a guideline in writing, not a finished product ready to publish. You should use it when you prepare to write a rough draft, before you started writing.

8 0
3 years ago
Plz help me i need it asap
Ulleksa [173]

Voyager

Shortly after the Pioneers made their flybys, the Voyager1 and Voyager 2 probes followed. They made many important discoveries aboutJupiter and Saturn, including rings around Jupiter and the presence ofvolcanism on Jupiter's moon, Io. Voyager went on to make the first flybys ofUranus, where it discovered 10 new moons, and Neptune, where it found thatNeptune actually weighs less than astronomers thought. Both Voyager crafts have enough power to keep transmitting radio signals until at least 2025, and are now exploring the very edge of the solar system and beginning of interstellar space. Voyager 2 is currently the farthest man-made object from Earth, at more than a hundred times the distance from the Earth to the sun, and more than twice as far as Pluto.

I hope this helps chu

4 0
3 years ago
What are the uses of DVD Ram​
Verdich [7]

Answer:

Like ordinary random access memory (RAM), it can be repeatedly read, written to, and erased. Intended mostly for removable computer storage, DVD-RAM provides the capabilities of Rewriteable CD (CD-RW) - users can run programs from the discs, copy files to them and rewrite or delete them.

4 0
2 years ago
Read 2 more answers
Other questions:
  • You've decided to use a subnet mask of 255.255.192.0 with your 172.17.0.0 network to create four separate subnets. The network I
    13·1 answer
  • Grace Hopper led the development of ______, a programming language for business applications.
    6·2 answers
  • What do economists call a decline in the real GDP combined with a temporary rise in price level?
    8·2 answers
  • Use the _______ to add a line or circle to your presentation.
    8·1 answer
  • Enter a character: * ASCII #42 Enter a character: exit Not a character
    7·1 answer
  • highlight the possible risks and problems that should be address during the implementation of information system process
    5·1 answer
  • Which are examples of types of audio media that can support a presentation? Check all that apply.
    14·2 answers
  • How do Brainly experts and verified users format their answers to look like this:
    12·2 answers
  • 1. The running configuration is also known as the _____________ (Select Two) a. Startup config b. Working configuration c. Curre
    14·1 answer
  • Would it be feasible to combine fixed length field and variable length field format in single disk
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!