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
My name is Ann [436]
3 years ago
6

The function's only behavior should be to return the sum of array userVals' elements. What common error does the function make?

Computers and Technology
1 answer:
lara31 [8.8K]3 years ago
7 0

Answer:

A. Attempts to access an invalid element.

Explanation:

The C program above is supposed to loops 10 times to get the total of the userVal's element, but the loop is assigning the cumulative sum of the to each nth index of the userVal array. Although the cumulative total of the array is assigned to the last index, the return statement is attempting to return an invalid element (since i is local only to the for loop statement). The program should return the userVal[9] instead.

You might be interested in
Write an application that prompts a user for two integers and displays every integer between them. Display There are no integers
olga2289 [7]

Answer:

x = int(input("Enter an integer: "))

y = int(input("Enter another integer: "))

if x > y:

   for number in range(y+1, x):

       print(number, end=" ")

elif y > x:

   for number in range(x+1, y):

       print(number, end=" ")

else:

   print("There are no integers between {} and {}".format(x, y))

Explanation:

*The code is in Python.

Ask the user to enter the two integers, x and y

Since we want our program to run regardless of which entered value is larger, we need to compare the numbers to be able to create the loop that prints the numbers.

Check if x is greater than y. If it is, create a for loop that iterates from y+1 to x-1 and print the numbers

Otherwise, check if y is greater than x. If it is, create a for loop that iterates from x+1 to y-1 and print the numbers

If none of the previous part is executed, print that there are no integers between

4 0
3 years ago
Strfrtvt tr rt tr trrrttr rrt
solong [7]

Answer:

????......???...................

5 0
3 years ago
A(n) _____ allows individuals to create and publish a profile, create a list of other users with whom they share a connection (o
Mice21 [21]

Answer:

Social Networks

Explanation:

Social Network provides a way for users to create a profile, create a list of other users whom they share a connection with. This allows users to connect with other users who share similar interests with them. Businesses can also leverage the power of the social network to boost their sales and gain more reach and visibility.

4 0
3 years ago
How is your favorite singer and why I will give Brainliest
Lorico [155]

Answer:

Eslabon Armando

His songs hit different ;-;

5 0
2 years ago
Read 2 more answers
A. True
gavmur [86]
True ? They have to be of the same type, comatible isn't absolute enough. But I may be overthinking it.
6 0
3 years ago
Other questions:
  • The method header of the equals() method within the string class is ____.
    13·1 answer
  • Special characters that display on the screen but do not print are called _____________
    15·1 answer
  • Describe three types of physical storage currently used. what usage scenarios would be ideal for each?
    7·1 answer
  • You need a collection to represent secret agents. Every agent has a unique codename that identifies them, and an Agent object th
    14·1 answer
  • Witch of the following is a valid why a scientist might a scientific theory
    13·1 answer
  • Which entity might hire a Computer Systems Analyst to help it catch criminals?
    12·2 answers
  • What are 3 software programs for mobile computing?
    10·1 answer
  • Please help it’s timed
    5·1 answer
  • Which of the columns (A) to (I) in the truth table below is correct for the expression
    13·2 answers
  • "if" statements are part of creating computer programs, what are these instructions called and how would you use them?
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!