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
Aleksandr [31]
3 years ago
8

Given an array of integers an). The array is already NOT write C++ statements to fill the array eye write C++ statements that pr

int to the screen how many values in the how many values are odd. In addition, the statements output to the scre the array that are even. s
Computers and Technology
1 answer:
Nataliya [291]3 years ago
3 0

Answer:

#include<iostream>

using namespace std;

int main () {

   int n;

   int odd=0,even=0;

  cout<<"Enter the number of element store in the array: ";

  cin>>n;

  int arr[n];

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

     cin>>arr[i];

  }

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

       if(arr[i]%2==1){

           odd++;

       }else{

           even++;

       }

  }

  cout<<"The number of odd values is: "<<odd<<endl;

  cout<<"The number of even values is: "<<even<<endl;

}

Explanation:

Include the library iostream for input/output.

Create the main function and declare the variables.

Then, print the message on the screen and store the value enter by the user for the size of the array. After that, take a for loop and store the values in the array enter by the user.

then, take a for loop for traversing to the array and check the condition for odd and even by using if-else statement.

for odd: If odd values divided by 2 it gives 1 remainder.

for even: If even values divided by 2 it gives zero remainder.

if condition true, then update the counter.

finally, print the result.

You might be interested in
Which statements describe OneDrive?
Vesna [10]

Answer:

OneDrive is a storage location on your personal computer.

Explanation:

Its gives u extra storage as well as helps u to take backup for all ur files that are important to u

Hope this helps...

Pls mark my ans as brainliest

If u mark my ans as brainliest u will get 3 extra points

6 0
3 years ago
Read 2 more answers
Cloud computing service providers manage different computing resources based on the services they offer. Which resources do IaaS
eimsori [14]

Answer:

1. C.operating system

2. A.applications

Explanation:

1. The Iaas is the infrastructure as a service, and storage, server, and network are the infrastructures. However, the Operating System is the platform, and hence it is the correct option for the first blank. We need to understand the exact meaning of the IaaS, PaaS and the SaaS as well as MaaS, to better understand cloud computing.

2. In the second case, we have been asked about the option that is not being covered by the PaaS, and Paas stands for the platform as a service. And the interface, storage, and virtualization is the platform whereas the Applications is an example of software. And it is being managed by SaaS, Hence, the correct option is A. Applications.

7 0
3 years ago
Part 1: Implement a superclass BankAccount that has the following fields and methods.
Alja [10]

Answer:

sorry idk

Explanation:

3 0
4 years ago
What are two reasons to tie cables up and out of the way inside a computer case?
vichka [17]

There are 4 reasons why we have to tie the cable and get out of the computer case. This reason is very important to take care of our computers, namely

  • It keeps the cable from blocking the moving parts
  • It stops the cable from moving, preventing a short circuit if the cable wears out.
  • This keeps cables away from thermal hotspots such as CPU or GPU heatsinks, which can reach very high temperatures, making cable insulation brittle
  • It keeps cables from blocking airflow, which is necessary to reach the heatsink and hard drive.

Hardware is best defined as any physical component of a computer system that contains circuit boards, ICs, or other electronics. An example of hardware is the screen on which you are viewing this page. Whether it's a monitor, tablet or smartphone, it's hardware.

Hardware is also a very important component, without any hardware, a computer would not exist, and software would be unusable. Images such as the computer screen are examples of external hardware. This hardware allows users to take videos or pictures, and send them over the Internet.

You can learn more about Hardware here brainly.com/question/15232088

#SPJ4

6 0
2 years ago
Which type of transaction cannot be tagged at this time within Quickbooks online
photoshop1234 [79]
You can't tag general journal entries or transfers. You also can't tag things like customers or items.
4 0
3 years ago
Other questions:
  • A ____ is a structure that allows repeated execution of a block of statements.
    13·2 answers
  • What should you keep in mind when installing hard drives?
    5·1 answer
  • The area that holds all the instructions the computer needs to start up when it is powered on is ________.
    11·1 answer
  • What are the 3 parts of a browser window? What componets are in each?
    5·1 answer
  • 4. When emergency changes have to be made to systems, the system software may have to be modified before changes to the requirem
    13·1 answer
  • . char values are surrounded by _____ quotes
    15·1 answer
  • PowerPoint:
    7·2 answers
  • What can i use to erase data off computer and what name of it and steps
    9·1 answer
  • What is adobe photoshop?
    10·2 answers
  • Brian needs to see the space available to insert content on a slide in his presentation which feature of the presentation should
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!