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 microphone, a track ball, and speakers are all examples of ____. hardware software
djyliett [7]
Hardware . . . . . . . . . . . .  . . . . . . .. 
3 0
3 years ago
Read 2 more answers
How to fix this.. facing this problem to upload logo
AlekseyPX
I use an app called codechecker that helps with me having issues like that cause 99% of the time I'll mess it up.
7 0
3 years ago
Why is being distracted by the sights and sounds of our devices dangerous?​
11111nata11111 [884]

Answer:

because we lose our reflexes and our lucidness... if we r in our devices we dont see the world. we dont see the dangers we dont see or feel what we need to to survive. we find safety in things like electronics but they will never help us when it comes to real life problems. like if we are going to get hit by a car we are reading our phone not looking at our surroundings not listening to the warnings.

Explanation:

hope this helps

8 0
3 years ago
Hi AllyUbongAbasiEtuk
Ainat [17]

Answer:

not a valid question

Explanation:

4 0
4 years ago
Read 2 more answers
Maria is developing an online gaming website. She is working on an interactive game that has a central character guiding visitor
hammer [34]

Answer:

The answer is animation. This question has been answered already.

Source:

brainly.com/question/12414395

8 0
2 years ago
Other questions:
  • Which sentences in the passage show the preventive measures to avoid data breach?
    9·1 answer
  • While there are many types of sediments, those that make up sedimentary rocks must be transported by running water.
    9·1 answer
  • Which of the instances below is an example of a Trojan horse? Question 2 options: a) An attachment in an email that is really a
    8·2 answers
  • Plz Help Me!! When you are done with the computer what should you do? Why/Why not?
    12·1 answer
  • State two ways a local area network can be used to monitor the work of employees
    11·1 answer
  • When communicating with a server on another subnet, which of the following settings is used to determine which direction it need
    6·1 answer
  • Here is free points im leaving
    11·2 answers
  • The purpose of a report is to
    13·1 answer
  • You are an ISP. For the Address Block 195.200.0.0/16 a. If you have 320 Customers that need 128 addresses/customer - will there
    6·1 answer
  • I finished all my final exams 100 on math 100 on science and 94 on language arts.
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!