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
kumpel [21]
3 years ago
14

) Consider the array called myArray declared below that contains and negative integers. Write number of positive integers in the

array. That is, your loop display the message "Number of positive integers is 5" a loop statement to count and display the should (4 points) int myArray[]卟1,3,-9,9,33,-4,-5, 100,4,-23); Note: The loop should always work without modification even if the values in th array are changed
Computers and Technology
1 answer:
grigory [225]3 years ago
6 0

Answer:

#include <iostream>

using namespace std;

int main()

{

 

  int arr[]={3,-9,9,33,-4,-5, 100,4,-23};

  int pos;

  int n=sizeof(arr)/sizeof(arr[0]);

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

      if(arr[i]>=0){

          pos++;

      }

  }

  cout<<"Number of positive integers is "<<pos<<endl;

  return 0;

}

Explanation:

create the main function in the c++ programming and declare the array with the element. Then, store the size of array by using the formula:

int n=sizeof(arr)/sizeof(arr[0]);

after that, take a for loop for traversing the array and then check condition for positive element using if statement,

condition is array element greater than or equal to zero.

if condition true then increment the count by 1.

this process happen until the condition true

and finally print the count.

You might be interested in
A legend in Excel is __________.
KIM [24]

Answer:

an information key that explains how information in a chart is represented by colors or patterns

Explanation:

This is the information that is used to explain the data in the graph.

4 0
4 years ago
Read 2 more answers
Are our current copyright policies helping society or hurting society? i need help
Oksanka [162]

Answer:

helping society

Explanation:

it can help you to protect your works and creativity and brilliant ideas from liars and cheaters and frauds

5 0
3 years ago
Higher-speed Ethernet technologies use an electronic device known as a Hub rather than a switch True/False
Ivenika [448]
This should be false
4 0
3 years ago
The java compiler is able to find all programmer errors.
Troyanec [42]
No compiler can do that. Maybe with AI, but that's beyond the scope of a compiler.
5 0
4 years ago
A business-to-consumer (B2C) website tracks the items you place in a shopping cart using _____. Group of answer choices the Tran
steposvetlana [31]

Answer:

The answer is "cookies".

Explanation:

The B2C websites refer to companies, that directly sell services and products without the need for a distributor. It refers to the online merchants, which provide the offer on the products and services via the internet to customers.  It uses the cookie in a small amount of data within the browser memory for the process and once you visit those websites on the internet, OS transfer cookies for your internet browser. It includes an ID as well as its URL, and the incorrect choice can be defined as follows:

  • The TLS protocol is the wrong choice because it is used in the privacy and data security.
  • The crawlers are also a wrong choice because it is used in automatically searches.
  • An electronic wallet is used to store your money, that's why it is wrong.
7 0
4 years ago
Other questions:
  • What finacial behaivor will typically lead to a low credit score
    8·1 answer
  • Operating system software allows you to use your fingers, a mouse or other pointing device to select screen controls, such as bu
    5·2 answers
  • Editing and sorting the data file are steps performed during the ________ stage in the data processing cycle
    5·1 answer
  • Given that k refers to an int that is non-negative and that plist1 has been defined to be a list with at least k 1 elements, wri
    14·1 answer
  • An “evil twin” in the context of computer security is: a) A virus-laden attachment that looks just like a sincere attachment b)
    5·1 answer
  • When activated, an Excel object has all the features of an Excel
    8·2 answers
  • Nancy malone works for a california-based computer manufacturer. according to nancy, the time required to develop a new product
    6·1 answer
  • What does gigabyte mean
    12·1 answer
  • HELP AASAP BRAINLIEST JUST HELP
    13·1 answer
  • Encoding in the information processing theory is the process of _____
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!