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
DanielleElmas [232]
3 years ago
6

Add each element in origList with the corresponding value in offsetAmount. Print each sum followed by a space. Ex: If origList =

{4, 5, 10, 12} and offsetAmount = {2, 4, 7, 3}, print: 6 9 17 15
Computers and Technology
1 answer:
Darya [45]3 years ago
5 0

Answer:

#include <stdio.h>

int main(void) {

const int NUM_VALS = 4;

int origList[NUM_VALS];

int offsetAmount[NUM_VALS];

int i;

origList[0] = 20;

origList[1] = 30;

origList[2] = 40;

origList[3] = 50;

offsetAmount[0] = 5;

offsetAmount[1] = 7;

offsetAmount[2] = 3;

offsetAmount[3] = 4;

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

{

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

}

printf("\n");

return 0;

}

Explanation:

  • Initialize the origList and offsetAmount variables.
  • Loop up to the value of NUM_VALS variable.
  • Display the output by combining origList and offsetAmount.
You might be interested in
OMG 2 TIMES ;DDDDDDDDDDDDDDDDD​
torisob [31]

Answer:

Keep going! Nice!

Explanation:

INSANE :D

4 0
3 years ago
What two things should you do before starting the design process
Charra [1.4K]

Answer: B and C

Explanation: Analyze the audience

                      Identify the problem

8 0
3 years ago
Programmers say the data items are ____ only within the module in which they are declared.
Oksanka [162]
Data items are "local".

Consider the following example in C++.


class MyClass
{
public:
    void setX(int x)
    {
        this->x = x;
    }

private:
    int x;
};


We have an integer variable local to the scope of the class declaration, and we have another integer variable local to our setX() function, though we have no global functions, that's something you want to try to avoid as a general rule of thumb.
6 0
4 years ago
Calculator is an example of
Shalnov [3]

D. digital

Explanation:

I hope it helps you

7 0
3 years ago
In a nested repetition structure, one loop, referred to as the ____ loop, is placed entirely within another loop, called the ___
Alja [10]

Answer:

Inner, outer

Explanation:

Bruh. Its logic

3 0
3 years ago
Other questions:
  • The RAM is a type of ____ a.Main Memory b.Secondary Memory c.Human Memory d.EPROM e.EEPROM
    13·2 answers
  • Which of these automotive repair areas helps the vehicle change speeds to operate efficiently under all conditions?
    5·1 answer
  • A card ____ is a device that reads data, instructions, and information stored on flash memory cards.
    8·1 answer
  • The sequence of folders to a file or folder is called a(n) ________
    8·1 answer
  • Can you give me a long list of kid's cartoons
    8·2 answers
  • 3. By eliminating data redundancy, you're enforcing data A. validation. B. integrity. C. consistency. D. accuracy.
    14·2 answers
  • 6) Sometimes it is difficult to read a piece of code and understand what the code will do. For this reason, you may want to add
    9·1 answer
  • The __________ logical operator works best when testing a number to determine if it
    12·1 answer
  • 1.6.M - Assignment: Understanding If Else Statements in Python
    7·1 answer
  • Explain with examples what is software​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!