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
Elenna [48]
3 years ago
10

Write a C++ program that takes as input a list ( an array) of n integrers and finds the number of negative inetgers inthe list (

array ).
Side Note: The problem did not come out ofthis book but the information that I study is from this book. And Iam not getting how to write the program.
Computers and Technology
1 answer:
telo118 [61]3 years ago
6 0

Answer:Following is the program for the count of negative integers in an array:-

#include <bits/stdc++.h>  

using namespace std;

int main()

{

   int n,count=0;//declaring 2 variables n and count and initializing count with 0..

   cout<<"Enter the size of the array"<<endl;

   cin>>n;//prompting the size of the array...

   int negative_nums[n];//array of integers of size n..

   cout<<"Enter the numbers"<<endl;

   for(int i=0;i<n;i++)

   cin>>negative_nums[i];//prompting elements of the array...

   for(int i=0;i<n;i++)//iterating over the array....

   {

       if(negative_nums[i]<0)// if integer in the array at ith position is negative...  

       count++;// increasing the count...

   }

   cout<<"The number of negative numbers are "<<count<<endl;//printing the count of negative integers...

   return 0;

}

Explanation:

1. In the program i have taken a count integer initializing it with 0

2. Iterating over the array.

3. If the element at ith position is less than zero then increasing the count by 1.

4.Printing the count of negative integers in the array.

You might be interested in
Write a program that asks the user to provide a word, validate that it is a word, and print the word.
natta225 [31]

Answer:

be clearer. your question doesn't seem to be presented well

8 0
3 years ago
If int a = 4, int *b = &amp;a , int **c= &amp;b;<br> what is the value store in c.
Elenna [48]

Answer:

5.

Explanation:

6 0
3 years ago
TWO QUICK QUESTIONS
andrezito [222]
I'm guessing 8? But I'm not 100% positive 
5 0
3 years ago
Which of the following is an online library?
Mice21 [21]
Answer A. Hope it helped c:
4 0
3 years ago
Read 2 more answers
True or false? a router is a network device that directs packets over a network towards their final destination.
Alex_Xolod [135]

A router is a web device that directs packages over a web towards their final destination is true.

<h3>What is the router?</h3>
  • A router is a machine that combines two or more packet-switched grids or subnetworks.
  • A router accepts and data transmits  on computer networks. Routers are sometimes confused with network hubs, modems, or network controllers.
  • However, routers can integrate the functions of these components, and secure with these devices, to improve Internet entry or help create interaction networks.
  • A router is a device that is used for forwarding the internet connection to all the related devices.
  • A Wi-Fi connects the networking parts of a router and a wireless access point.
  • A wireless router (or Wi-Fi router) works much like a wired router, but it returns wires with wireless radio calls.

To learn more about router, refer to:

brainly.com/question/24812743

#SPJ4

7 0
1 year ago
Other questions:
  • Apple was a pioneer in user interface development, introducing the _____, complete with mouse and screen icons, in the early 198
    7·1 answer
  • Why is the keyboard arranged in the QWERTY style?
    6·2 answers
  • Which CSS attribute would change an element's font color to blue? font-color: blue; background: blue; color: blue; background-co
    10·2 answers
  • Which value can be entered to cause the following code segment to display the message: "That number is acceptable." int number;
    11·1 answer
  • Define the following BASIC terms:<br> 1. Keywords<br> 2. Constants<br> 3.Variables
    8·1 answer
  • Presentation graphics programs contain an assortment of tools and operations for creating and editing slides, including preforma
    8·2 answers
  • The operating system (OS) of an information system contains the software that executes the critical functions of the information
    6·1 answer
  • How many voltage values can be represented with a 10-bit binary code?
    15·1 answer
  • PLS HURRY<br> Look at the image below
    8·1 answer
  • What component of a game makes victories feel earned and helps the player become physchologically engaged by the play experience
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!