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]
4 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]4 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
What are two characteristics of switches? (Choose two.) * 1 point A. Switches identify the intended destination of the data that
tigry1 [53]

Answer:

A. Switches identify the intended destination of the data that they receive. And C. Switches are capable of sending and receiving data at the same time

Explanation:

Switches can be used as inputs (Analog), or outputs (digital). These inputs and outputs are signals that the switches send or receive- Or at least as push button switches... But the same applies to network switches.

Hope this helps! Have a great day!

7 0
3 years ago
1. What arguments can you make for the idea of a single language for all programming domains
SVEN [57.7K]

Answer:

The answer to this question defined below.

Explanation:

It's a smart idea to get a common language for coding of every kind. It would help all developers and customers understand the language better because, in every case, there's no more need to learn, that language.  

  • This could also render software developed in the very same language consistent, and therefore, ports on multiple platforms are not required.
  • In this process, we talk about the common property and function of the classes, that's why it is the correct answer.
3 0
3 years ago
This is me lol jjaaaabbooo
ElenaW [278]

i like your glasses uwu

6 0
3 years ago
Which of the following is a good way to improve your credit score?
Ganezh [65]
The answer is chope this helps
6 0
3 years ago
Bro how the hell do u do full screen on windows
Rudik [331]

Answer:

You'll need to hold down/click<em> </em>f11 and fn at the same time.

If not that, try ctrl + shift + f5.

I can guarantee the first works; not too sure about the second.

Explanation:

Well, it's hotkeys, so...

<em>EDIT: The f5 command does nothing related to full screen, my bad.</em>

7 0
3 years ago
Read 2 more answers
Other questions:
  • I need the alphabet quickly! sorry bad with remembering!
    10·1 answer
  • Write a statement that declares a prototype for a function add, which has two int parameters and returns an int .
    13·1 answer
  • In Microsoft Word, when you highlight existing text you want to replace, you're in <br>     
    12·2 answers
  • What does it mean to design,<br> implement, and maintain computer<br> systems?
    15·1 answer
  • Which of the following statements about the break statement is false? Group of answer choices Common uses of the break statement
    12·1 answer
  • Why is it so important to adhere to principles that have been put forth by reputable organizations to ensure that you are mainta
    10·1 answer
  • A ___________ variable is used to add up a set of values. fill in the blank
    8·1 answer
  • What is one example of an emerging class of software
    12·1 answer
  • What would a programmer use to stop a while-looping sequence and return to the beginning of the statement?
    11·2 answers
  • Which company introduce the first Minicomputer in 1960.​
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!