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
Which of the following statements are true about mobile app development? Select 3 options.
mestny [16]

Answer:

Option 1,4 and 5 are correct.

7 0
3 years ago
Read 2 more answers
What is the computer’s natural language?
kirill [66]

Answer:

binary computer natural language

4 0
3 years ago
Can some one help me answer this question plz
sergij07 [2.7K]

Answer:

In mathematics and digital electronics, a binary number is a number expressed in the base-2 numeral system or binary numeral system, which uses only two symbols: typically "0" (zero) and "1" (one). The base-2 numeral system is a positional notation with a radix of 2. Each digit is referred to as a bit, or binary digit.

Explanation: and the key to reading binary is separating the code into groups of usually 8 digits and knowing that each 1 or 0 represents a 1,2,4,8,16,32,64,128, ect. from the right to the left. the numbers are easy to remember because they start at 1 and then are multiplied by 2 every time.

5 0
3 years ago
Is the following an example of social media viral marketing? Indicate your response by selecting yes or no. When you sign onto y
Vladimir [108]

Answer

yo im sorry give me points b

Explanation:

gasefe

3 0
3 years ago
What is the extension of excel worksheet​
muminat

Answer:

Excel file formats

Format Extension

Excel Workbook .xlsx

Excel Macro-Enabled Workbook (code) .xlsm

Excel Binary Workbook .xlsb

Template .xltx

7 0
2 years ago
Other questions:
  • Exposing employee and customer personal data to an untrusted environment is an example of:
    9·1 answer
  • Becky is preparing a document for her environmental studies project. She wants to check her document for spelling and grammar er
    5·2 answers
  • What is the difference between 1080p and 2k?
    14·1 answer
  • ou work as network administrator for an organization that has a Windows-based network. You want to use multiple security counter
    10·1 answer
  • Which of the following is a special-purpose computer that functions as a component in a larger product?
    6·1 answer
  • A type of VPN connection, where a single computer logs into a remote network and becomes, for all intents and purposes, a member
    13·1 answer
  • All dogs = 199999990158161231
    11·2 answers
  • What are your considerations in making a derivative ict content ti effectively communicate or present data or information?
    11·1 answer
  • How have you improved the technology function to provide the right services at the right price and right level of quality?
    7·1 answer
  • What tool allows you to search external competitive intelligence research?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!