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
kramer
3 years ago
13

Int[] numList = {2,3,4,5,6,7,9,11,12,13,14,15,16}; int count=0; for(int spot=0; spot

Physics
1 answer:
pickupchik [31]3 years ago
4 0

Hi, there is not much information about what do you need to do, but base on the C++ code you need to complete it to count the number of items in the array, using the instructions already written.

Answer:

#include <iostream>

using namespace std;

int main()

{

   int numList [] = {2,3,4,5,6,7,9,11,12,13,14,15,16};

   int count=0;

   for(int spot=0; spot < (sizeof(numList)/sizeof( numList[ 0 ])); ++spot)

   {

        cout << numList[spot];

        cout << "\n";

        ++count;

   }

   cout << "The number of items in the array is: ";

   cout << count;

   return 0;

}

Explanation:

To complete the program we need to finish the for statement, we want to know the number of items, we can get it by using this expression:  (sizeof(numList)/sizeof( numList[ 0 ])), sizeof() function returns the number of bytes occupied by an  array, therefore, the division between the number of bytes occupied for all the array (sizeof(numList)) by the number of bytes occupied for one item of the array (sizeof( numList[ 0])) equal the length of the array. While iterating for the array we are increasing the variable count that at the end contains the result that we print using the expression cout << "The number of items in the array is: "

You might be interested in
I need help asap plz and thank you
Salsk061 [2.6K]

Answer:

tkcs5ufarhjccdrryuydfypuyffj9

Explanation:

hshejjfhbddkjdnrjdgdngkvksvrhvimwgrhffmbvhc

3 0
3 years ago
An equipotential surface must be
devlian [24]

Answer: An equipotential surface must be perpendicular to the electric field at every point. The correct option is B.

Explanation: Equipotential surface is any surface over which the potential difference is constant. Examples include:

-The surface of a conductor in electrostatic field.

- surface of a liquid in equilibrium.

Equipotential surface are perpendicular to the electric field at every point because components of electric field intensity along the surface is zero ( this is because no work is done while moving a charge from one point to another on an equipotential surface).

8 0
3 years ago
What equation is used to calculate momentum
Dmitrij [34]

Answer:

p = m v

Explanation:

You can see from the equation that momentum is directly proportional to the object's mass (m) and velocity (v). Therefore, the greater an object's mass or the greater its velocity, the greater its momentum. A large, fast-moving object has greater momentum than a smaller, slower object.

6 0
3 years ago
A constant net force acts on an object. which of the following best describes the object's motion?
Anton [14]
The object<span> is moving with a decreasing acceleration. The </span>object<span> is moving with </span>a constant<span> velocity.</span>
4 0
4 years ago
What is the Asch experiment
Leokris [45]

Answer:

the experiment that Asch was studying was how individuals yielded to or defied a majority of groups and the effect of such influences on beliefs and options

4 0
4 years ago
Other questions:
  • A bowling ball has a mass of 15.5kg. what is its weight on earth
    12·1 answer
  • Which of the following is the number of cycles per unit of time? infrasonis wave,frequency,ultrasonic wave or pitch
    15·2 answers
  • In an adiabatic process:
    13·1 answer
  • What type of circuit is illustrated?
    7·1 answer
  • Why are some scientists skeptical of the scientists results and conclusions
    6·1 answer
  • If an undamped spring-mass system with a mass that weighs 6 lb and a spring constant 1 lb/in is suddenly set in motion at t = 0
    10·1 answer
  • Un cilindro contiene 10 L de oxígeno y otro contiene 10 L de dióxido de carbono, ambos se encuentran a 25 °C. De acuerdo con el
    11·1 answer
  • I wanna die how do i die.
    7·2 answers
  • 7. MANSON'S FAVORITE SINGING GROUP WAS...
    7·1 answer
  • A breaker holds 124.9 g of water. The initial temperature of the water is 22.3 C how much energy is needed to raise the temperat
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!