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
satela [25.4K]
3 years ago
15

Multiply each element in origList with the corresponding value in offsetAmount. Print each product followed by a semicolon (no s

paces). Ex: If the input is: 4 5 10 12 2 4 7 3 the output is: 8; 20;70; 36; 1 #include 2 3 int main(void) { 4 const int NUM_VALS = 4; 5 int origList[NUM_VALS]; 6 int offsetAmount [NUM_VALS]; 7 int i; 8 9 scanf("%d", &origList[0]); 10 scanf("%d", &origList[1]); 11 scanf("%d", &origList[2]); 12 scanf("%d", &origList[3]); 13 14 scanf("%d", &offsetAmount[0]); 15 scanf("%d", &offsetAmount[1]); 16 scanf("%d", &offsetAmount[2]); 17 scanf("%d", &offsetAmount[3]); 18 19 \* Your code goes here */ 20 21 printf("\n"); 22 23 return 0; 24
Computers and Technology
1 answer:
oee [108]3 years ago
5 0

Answer:

Replace /* Your code goes here */  with

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

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

printf(";");

}

Explanation:

The first line is an iteration statement iterates from 0 till the last element in origList and offsetAmount

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

This line calculates and print the product of element in origList and its corresponding element in offsetAmount

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

This line prints a semicolon after the product has been calculated and printed

printf(";");

Iteration ends here

}

You might be interested in
A network host with an IP address of 192.168.10.200 wants to send a message to a destination computer with an assigned IP addres
Mariulka [41]

Answer:

A Subnet Mask

Explanation:

A Subnet mask is used by the TCP/IP protocol to determine whether a host is on the local Subnet or on a remote network.

In TCP/IP, the parts of the IP address that are used as the network and host addresses are not fixed, so the destination host address 192.168.10.100 cannot be determined by the network host (192.168.10.200) unless it has more information. This information is supplied in another 32-bit number called a Subnet mask.

4 0
4 years ago
ANSWER THIS CORRECTLY FOR BRAINLIEST
jeka57 [31]
The answer is https it is on Every url
6 0
3 years ago
Read 2 more answers
A multinational pharmaceutical company used a saffron trident in a promotional campaign for one of its drugs in India. The saffr
Vera_Pavlovna [14]
Answer : Encoding

Explanation : Encoding refers to correctly coding the message so that the receiver gets the clear message without feating any misunderstanding.
5 0
3 years ago
Will Give Brainliest
DENIUS [597]

Answer:

I would think Creativity, but im not sure-

6 0
3 years ago
Concept of national sovereignty was established by the
Eduardwww [97]

Answer:

Explanation:

Thomas Hobbes. He was the one who provided the term with its modern meaning.

7 0
4 years ago
Other questions:
  • Side mirror using convex mirror or concave mirror?​
    5·2 answers
  • "when a dynamic web page is requested, the web server passes the request to"
    15·1 answer
  • Does Android have text-to-voice?
    11·1 answer
  • Which formal security-related process should take place at the beginning of the code creation project? Group of answer choices R
    13·1 answer
  • In a non-formatted/standard template, if the number 25 is converted to text format, the
    14·1 answer
  • If you are working with a team of students on a class project and your team chooses to share content by uploading Word and Excel
    13·1 answer
  • Write a Java program that prompts the user for an int n. You can assume that 1 ≤ n ≤ 9. Your program should use embedded for loo
    5·1 answer
  • . The electric company charges according to the following rate schedule: 9 cents per kilowatt-hour (kwh) for the first 300 kwh 8
    12·1 answer
  • Computer programming 5
    10·1 answer
  • A hacker is trying to gain remote access to a company computer by trying brute force password attacks using a few common passwor
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!