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
nasty-shy [4]
4 years ago
5

Jump to level 1 Subtract each element in origList with the corresponding value in offsetAmount. Print each difference followed b

y a space. Ex: If origList = {4, 5, 10, 12} and offsetAmount = {2, 4, 7, 3}, print: 2 1 3 9 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 #include #include using namespace std; int main() { const int NUM_VALS = 4; int origList[NUM_VALS]; int offsetAmount[NUM_VALS]; int i; cin >> origList[0]; cin >> origList[1]; cin >> origList[2]; cin >> origList[3]; cin >> offsetAmount[0]; cin >> offsetAmount[1]; cin >> offsetAmount[2]; cin >> offsetAmount[3]; /* Your code goes here */ cout << endl; return 0; } 1 2 Check Next
Computers and Technology
1 answer:
Leto [7]4 years ago
3 0

Answer:

#include <stdio.h>

int main() {

   const int NUM_VALS = 4;

   int origList[NUM_VALS];

   int offsetAmount[NUM_VALS];

   int i;

   origList[0] = 40;

   origList[1] = 50;

   origList[2] = 60;

   origList[3] = 70;

   offsetAmount[0] = 4;

   offsetAmount[1] = 6;

   offsetAmount[2] = 2;

   offsetAmount[3] = 8;

   for (i = 0; i < NUM_VALS; ++i) {

       printf("%d ", origList[i] - offsetAmount[i]);

   }

   printf("\n");

   return 0;

}

Explanation:

  • After writing all the code given in the question, run a for loop until the variable i is less than the value of NUM_VALS constant.
  • In other words, the for loop will be executed 4 times as the value of NUM_VALS constant is equal to 4.
  • Inside the for loop display the results by subtracting offsetAmount from origList.
You might be interested in
What are the advantages of using variables in a data type?
mixas84 [53]

Answer:

A variable is a name associated with a data value; we say that the variable "stores" or "contains" the value. Variables allow us to store and manipulate data in our programs.

5 0
3 years ago
Why is audio greyed out on powerpoint ms office 2011?
-BARSIC- [3]
Because its a old type of software and probably wont run on your computer
7 0
4 years ago
When you write contracts, should you list many definitions at the start of the document?
aev [14]

Answer:

You can.

Explanation:

If you want you can, but usually as you cover topics you should list the definitions for each topic then instead of all at the beginning you do not want it to seem like it is a lot.  

4 0
3 years ago
After sending input in the Chinese language to an AI system, Nina got numerous translations in the English language. Which chall
ad-work [718]

Answer:

i think its translation complexity

Explanation:

8 0
3 years ago
¿Cuántos megabytes (MB) de capacidad tiene una memoria USB de 16 GB? el que me diga por que le doy una coronita
-Dominant- [34]

Answer:

16,384MB

Explanation:

1GB contiene 1024MB de capacidad. Si multiplicamos esto por 16 veemos que 16GB es igual a 16,384MB. Este seria el espacio exacto, aunque se dice que 1GB tiene 1000MB. Eso es por que la palabra Giga significa x1000 y el numero binario entero mas cercano a 1000 es 1024. Entonces los ingenieros usan este numero para representar la cantidad de espacio en un GB que tambien seria 2^{10}

7 0
3 years ago
Other questions:
  • The read/write heads of a hard disk gently rest on the hard disk platters in order to read and write the data.
    13·1 answer
  • Which type of operating system is usually used in personal computers?
    11·1 answer
  • NEED HELP PLEASE-
    7·2 answers
  • Commercial applications are never free<br><br> -True<br><br> -False
    9·1 answer
  • Is the jane austen pride and prejudie a primary source
    6·1 answer
  • __________ is a growing practice in cooperative farmingassociations to pool and sell the fruit as a common commodity underthe br
    6·1 answer
  • The method needed to arrange for an object to be notified when a window's close-window button has been clicked is
    6·1 answer
  • A test's directions often clarify any questions a student might have about answering a response question.
    5·2 answers
  • Which technology do online storesusually use to present customized content?
    10·1 answer
  • Please help me please please
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!