Write a C++ program to count even and odd numbers in array. The array size is 50. The array elements will be entered by the user.

Answers

Answer 1

Answer:

The program in C++ is as follows:

#include <iostream>

using namespace std;

int main(){

   int numbers[50];

   int evekount = 0, odkount = 0;

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

       cin>>numbers[i];

       if(numbers[i]%2==0){            evekount++;        }

       else{            odkount++;        }

   }

   cout<<"Even Count: "<<evekount<<endl;

   cout<<"Odd Count: "<<odkount<<endl;

   return 0;

}

Explanation:

This declares the integer array of number

   int numbers[50];

This initializes the even count and odd count to 0

   int evekount = 0, odkount = 0;

This iterates from 1 to 50

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

This gets input for the array

       cin>>numbers[i];

This checks for even

       if(numbers[i]%2==0){            evekount++;        }

This checks for odd

       else{            odkount++;        }

   }

This prints the even count

   cout<<"Even Count: "<<evekount<<endl;

This prints the odd count

   cout<<"Odd Count: "<<odkount<<endl;


Related Questions

Which of the following would not be stored in a cell ?

A. Formula
B. Text
C. Number
D. Chart​

Answers

Answer:

D

Explanation:

Because you can put formulas, text and numbers into a salad, but you can not put a chart interrupt because it won't fit in a cell.

Use the drop-down menus to complete the statements about printing Contacts. When printing a single contact, go to File and then Print; the only style available is Memo style . When printing multiple contacts, there are several styles to choose from.

Answers

Answer:

When printing a single contact, go to File and then Print; the only style available is Memo style .

When printing multiple contacts, there are several styles to choose from

Explanation:

The question has been answered (by you). I will help you with the explanation. The texts in bold in the answer section represent the answer.

The question is an illustration of Microsoft outlook.

In Microsoft outlook, the default style of printing is the memo style of printing. This is the only form of printing allowed when printing single contacts. In other words, other forms of printing cannot be selected.

However, there are several options available when multiple contacts are to be printied. Some of the printing styles are:  phone directory style, card style, medium booklet style, etc.

Answer:

1. is memo style

2. is mulitiple

Explanation:

The cafeteria is dark except for one light in the kitchen. The cafeteria manager is in there, counting lunch money. She says that there were some strangers in the school today and they ate lunch in the cafeteria.

Answers

Answer:

Explan

wha??! do u meana

Explain two ways by which the calendar meets or fails to meet the criteria of showing the correct data

Answers

Answer:

The two ways the calendar meets the criteria of showing the correct date are;

1) The calendar can give dates in the 12 months in a year

2) The calendar can show up to the 31 different days in a month

Explanation:

The two ways in which the calendar meets the criteria of showing the correct date are;

1) The number number of long blocks with 4 different months each = Three

Therefore, the total number of months the blocks can hold = 3 × 4 months = 12 months = The number of months in a year

2) The number of faces on each dice = 6 faces

The number of dice = 2 dice

The total number of faces = 12

The number of identical faces = 2 (11th and 22nd of the month)

The number of unique faces = 10

The number of combinations of the dices = ₁₀C₂ = 45

The number of combination of faces required to show = 1 to 31 = 31 combination

Therefore, there are adequate combinations on the dice to show all the dates of month

Check out this app! It's millions of students helping each other get through their schoolwork. https://brainly.app.link/qpzV02MawO ​

Answers

Answer:

Tamam hocam o zaman....

Define computer with its prossing meaning​

Answers

Answer:

The computer is a device that accepts information (in the form of digitalized data) and manipulates it for some result based on a program, software, or sequence of instructions on how the data is to be processed. Today's computers have both kinds of programming.

Explanation:

did you mean-Define computer with its processing meaning. °•°

Computer is a device that takes input, processes it and gives us output.

Ravi is writing an essay on the impact of the internet on business. Help him classify the scenarios he sees around him as positive and negative effects of the internet on business. He recently bought a second-hand camera online, which he hadn't been able to find in any store. A bookstore down the road shut down because people preferred the cheaper online bookstores. Ravi's sister complains that her boss always knows when she is late, but rarely greets her if their paths cross in office. His friend sells printed T-shirts online, storing them in his basement and promoting them on social media. One of his friend's printed T-shirts got wet and stained in the delivery truck and the buyer wrote a nasty review.

Answers

Answer: See explanation

Explanation:

Based on the options given, the positive effects of the internet on business will be:

• He recently bought a second-hand camera online, which he hadn't been able to find in any store.

• His friend sell printed T-shirts online, storing them in his basement and promoting them on social media.

The negative effects of the internet on business will be:

• A bookstore down the road shut down because people preferred the cheaper online bookstores.

• Ravi's sister complains that her boss always knows when she is late, but rarely greets her if their paths cross in office.

• One of his friend's printed T-shirts got wet and stained in the delivery truck and the buyer wrote a nasty review.

Summary of how I could use my Video Skills outside of school

Answers

Answer:

u can take videos of your journey

- enjoy the moment (like using videos in snap)

- you can record ur life

hope this helps

Answer:

you could make some videos for money

Explanation:

To indent an entire paragraph or list you should:

A. Use the paragraph spacing icon
B. Use the select icon
C. Use the tab key on your keyboard
D. Use the decrease indent icon

Answers

Answer:

C. Use the tab key on the keyboard

(a easier and fastest way to add a indent in the paragraph)

question no.3 a. Can someone pls help me

Answers

Answer:

A=1

B=1

C=0

X= OR

Explanation:

A is XOR

B is NOT

C is AND

X is OR

Se le conoce así cuando el analista mismo desarrolla el software necesario para implementar el diseño

Answers

Answer:

Desarrollo de software.

Explanation:

El método clásico de desarrollo de software se denomina modelo en cascada, lo que significa que cada fase de desarrollo del programa debe completarse antes de que comience la siguiente, y que se lleva a cabo un extenso trabajo de especificación antes de que comience el desarrollo real del programa. La especificación es tradicionalmente de arriba hacia abajo y el desarrollo se basa en una programación estructurada, es decir, se formula primero un objetivo final para el proyecto, y luego el programa se divide gradualmente en partes funcionales más pequeñas.

Los métodos más nuevos son ágiles y basados ​​en pruebas. Se basan en el desarrollo gradual de muchas entregas parciales del programa y permiten que las distintas fases de desarrollo se lleven a cabo de forma cíclica o en paralelo. Los clientes y usuarios ganan influencia a lo largo del proceso de desarrollo. El desarrollo y las pruebas de prototipos comienzan lo antes posible, antes de que estén listos todos los detalles de la especificación de requisitos. Las decisiones sobre la especificación de requisitos de las versiones de entrega se toman lo más tarde posible, cuando los usuarios han probado y comprendido lo que realmente quieren y existe un buen conocimiento de las necesidades, posibilidades técnicas y dificultades. Cambia entre el método de arriba hacia abajo (para comenzar desde el propósito y el objetivo) y el método de abajo hacia arriba (para comenzar con lo que ya tiene y puede reutilizar, y comenzar con casos especiales simples pero gradualmente hacer que el programa sea cada vez más general).

which of the following is not a bus type A. Address bus B. Data bus C. Memory bus D. Control bus ​

Answers

Answer:

Answer is memory bus.

Explanation:

Answer is memory bus.

Robots are more prevalent today than they were just a few years ago, tackling tasks that range in importance from cleaning floors to teaching students to diagnosing illnesses. With this progress comes possible job loss for janitorial personnel, educators, doctors, and others. Discuss some areas where you find this technology helpful as well as areas you feel more confident in human decision making. List some pros and cons of robotic technology and provide real life examples. For instance, many people would relish the thought of owning a robotic sweeper but would cringe if their children were being taught by a robot sporting a face and using personalized conversation.

Answers

Answer: Some areas that technology would be useful are Agriculture, Health Care, and the Military.

But some jobs that humans are better at could be jobs that require Creativity and strategic thinking

Explanation:

Hope this helped

Prompt: Create a program that asks the user continuously the dollar amount of their recent Amazon purchases until they say done. Store those numbers in a list. Afterwards calculate the following:
Total Amount Spent
Maximum amount spent on a single purchase
Minimum amount spent on a single purchase
Number of purchases
Amount of money spent on taxes. (Sales tax in NY is 8.875 percent).

Things to keep in mind:
Input is stored as string so you need to convert to float.
If you or your family use Amazon, try using your own data!

Pls Dont scam me

Answers

Answer:

oh sorry I don't know that but...

Explanation:

Thanks for the points hehe

Your computer monitor’s power switch is in the ‘ON’ position; however, the display is blank. Which of the following is NOT a likely cause of the problem? *
1 point
the interface cable may be loose
the network adapter is malfunctioning
monitor may be in sleep/hibernate mode
the monitor controls are improperly adjusted

Answers

Answer : Monitor may be in sleep/hibernate mode.

In which patten the modern computer work ?​

Answers

Answer:

Modern computers can perform generic sets of operations known as programs. These programs enable computers to perform a wide range of tasks.

Summary

In this lab, you complete a partially written C++ program that includes a function requiring multiple parameters (arguments). The program prompts the user for two numeric values. Both values should be passed to functions named calculateSum(), calculateDifference(), and calculateProduct(). The functions compute the sum of the two values, the difference between the two values, and the product of the two values. Each function should perform the appropriate computation and display the results. The source code file provided for this lab includes the variable declarations and the input statements. Comments are included in the file to help you write the remainder of the program.
Instructions

Write the C++ statements as indicated by the comments.
Execute the program by clicking the Run button at the bottom of the screen.

Grading

When you have completed your program, click the Submit button to record your score.



++// Computation.cpp - This program calculates sum, difference, and product of two values.
// Input: Interactive
// Output: Sum, difference, and product of two values.

#include
#include
void calculateSum(double, double);
void calculateDifference(double, double);
void calculateProduct(double, double);
using namespace std;

int main()
{
double value1;
double value2;

cout << "Enter first numeric value: ";
cin >> value1;
cout << "Enter second numeric value: ";
cin >> value2;

// Call calculateSum

// Call calculateDifference

// Call calculateProduct

Answers

Answer:

The functions are as follows:

void calculateSum(double n1, double n2){

   cout<<n1+n2<<endl; }

void calculateDifference(double n1, double n2){

   cout<<n1-n2<<endl; }

void calculateProduct(double n1, double n2){

   cout<<n1*n2<<endl; }

Call the functions in main using:

calculateSum(value1,value2);

calculateDifference(value1,value2);

calculateProduct(value1,value2);

Explanation:

This defines the calculateSum() function

void calculateSum(double n1, double n2){

This prints the sum

   cout<<n1+n2<<endl; }

This defines the calculateDifference() function

void calculateDifference(double n1, double n2){

This prints the difference

   cout<<n1-n2<<endl; }

This defines the calculateProduct() function

void calculateProduct(double n1, double n2){

This prints the product

   cout<<n1*n2<<endl; }

This calls each of the function

calculateSum(value1,value2);

calculateDifference(value1,value2);

calculateProduct(value1,value2);

See attachment for complete program

______ language is written using 0's and 1's​

Answers

Answer:

Binary language is written using 0's and 1's.

Explanation:

That language of 1's and 0's is called binary. Computers speak in binary because of how they are built.

That language of 1's and 0's is called binary. Computers speak in binary because of how they are built.

Alt +f4 is a short cut of close a document in MS word /ture /false​

Answers

Answer:

True.

Explanation:

Microsoft Word refers to a word processing software application or program developed by Microsoft Inc. to enable its users to type, format and save text-based documents.

In Computer science, there are specific key combinations (short cut) that avail end users the opportunity to perform specific functions without having to go through a series of step.

For example, when you press the Alt button and function key 4 (F4) at the same time, it would close the current open window.

Hence, Alt + F4 is a short cut key that can be used to close a document in MS word.

why should one avoid noise in the computer room​

Answers

is this a joke bc if so why?
This one not a joke hi it’s monika here

Do not make noise in the computer room.
I love to help

Below are the possible answer to each question write your answer in the space provided before each number

Answers

Answer:

Please find the complete question in the attached file:

Explanation:

1. primary memory

2. secondary memory

3. dynamic ram

4. HDD

5. SSD

6.Rom

7. video card

8. VRAM

9. random access memory  

10. processor

In an online shopping application, the primary case type PurchaseOrder has two child case types: Payment and Packaging. In processing PurchaseOrder case PO-11, Payment case Pay-37 and Packaging case Pac-56 are created. Which statement about the processing of PO-11, Pay-37, and Pac-56 is correct?
A. PO-11 has to be resolved before either Pay-37 and Pac-56 is resolved.
B. Pac-56 has to be resolved before Pay-37 is resolved.
C. Both Pay-37 and Pac-56 have to be resolved before PO-11 can be resolved.
D. PO-11 can be resolved when either Pay-37 or Pac-56 is resolved.

Answers

Answer:

The answer is "Option C".

Explanation:

The principal instance type PurchaseOrder has two types of instance children in an online purchasing application: Pay and Packing. Pay case Pay-37 and packing instance Pac-56 are designed to Sales Orders case PO-11 execution. All statements regarding PO-11, Pay-37, and Pac-56 should be settled before PO-11 may be addressed. Both Pay-37 and Pac-56.

Why is https used in every link of a website?

Answers

Answer:

As a request-response protocol, HTTP gives users a way to interact with web resources such as HTML files by transmitting hypertext messages between clients and servers. HTTP clients generally use Transmission Control Protocol (TCP) connections to communicate with servers.

What is the name of database of viruses that an antivirus software scan for?

Answers

Answer:

Anti virus scanner. i hope :)

Explanation:

When you apply _______ you insert a number slightly above the the line of text

A. Subscript
B. Underlining
C. Superscript
D. Text effects

Answers

Subscript 2020 on the edge

What is part of the third step in troubleshooting a computer problem?
O locating the problem and identifying it
O trying a number of simple fixes initially
O researching ways to solve the problem
O seeking help to solve the problem

Answers

Answer:

locating the problem and identifying it.

do earthquakes ever happen in Malaysia?​

Answers

The correct answer to this open question is the following.

Although there are no options attached we can say the following.

Do earthquakes ever happen in Malaysia?

Yes, they do. And they are very frequent and high in intensity.

For instance, the Sabah earthquake in 2015.

On June 5, 2015, the region of Malaysia was hit by a strong earthquake, 6.0 of magnitude on the Ritcher scale. The telluric movement lasted 30 seconds and caused much destruction.

Experts and scientists confirm that this had been the strongest earthquake since the one presented in 1976.

Which is the default data type of Ms-Access? (i) Memo (ii) Number (iii) Text (iv) Auto number​

Answers

Answer:

(iii) Text

Explanation:

A database management system (DBMS) can be defined as a collection of software applications that typically enables computer users to effectively and efficiently create, store, modify, retrieve, centralize and manage data or informations in a database. Thus, it allows computer users to efficiently retrieve and manage their data with an appropriate level of security.

Generally, a database management system (DBMS) acts as an intermediary between the physical data files stored on a computer system and any software application or program.

Hence, a software that enables the organization to centralize data, manage the data efficiently while providing authorized users a significant level of access to the stored data, is called a Data Base Management System (DBMS).

Text is the default data type of Microsoft Access (Ms-Access).

You have copied the data highlighted in the dotted box. What would be the result if you did PASTE command at the selected cell ?

Answers

Answer:

The data would be copied over to the new box

Explanation:

Give five examples of top level domain​

Answers

Answer:  .com — Commercial businesses.

.org — Organizations (generally charitable).

.net — Network organizations.

.gov — U.S. government agencies.

.mil — Military.

.edu — Educational facilities, like universities.

Explanation:

ANSWER BELOW.com — Commercial businesses.  .org — Organizations (generally charitable). .net — Network organizations. .gov — U.S. government agencies. .edu — (Educational facilities, like universities.)

Hope this helps!!! :)

Other Questions
I need help with this question. Whoever helps me I will mark branliest! NEED HELP! Will give brainiest!! And thanks if you even answer one of them 4(3p+2)-5(6p-1)=2(p-8)-6(7p-4) essay on advantages and disadvantages of mobile phones What part of the digestive system absorbs nutrients that our bodies need?A. MouthB. small intestineC. stomachD. large intestine What is FOLLOWING PROCEDURES Pleasssseeee helpp me pleaseeee I really need help !!! During January, Dream House Builders, Inc. incurred $550 of actual indirect materials costs, as supported by materials requisitions. Required:Draw the journal entry. What is the minimum value of the objective function, C with given constraints? C=5x+3y {x+3y9 {5x+2y20 {x1 {y2 PageE QON1 What is force ? Write its unit and mentionanythree effects of the force. The perimeter of a rectangle is 10 feet, and the area is 6 square feet. What is the width ofthe rectangle? find the domain f(x)=x-6 The width of a rectangle is represented by 2x and the length is represented by x2-x+ 3. Which expression represents the area of the rectangle? The width of the rectangle shown below is 10 inches the length is 4 feet what is the area of the rectangle in square inches Need to pass please help Which system of linear inequalities is represented by the graph?y > x 2 and y < x + 1y < x 2 and y > x + 1y < x 2 and y > x + 1y > x 2 and y < x + 1 Thomas is a commercial broker. He is representing the buyer in the purchase of an apartment complex in Dallas. Thomas also represents the seller. Both have authorized intermediary. The seller's attorney discloses to Thomas via email that the property has foundation issues but offers to increase Thomas' commission if Thomas doesn't tell the buyer. Thomas tells the buyer that there are no problems with the property, and the buyer ends up purchasing the property unaware of the foundation problems. Will Thomas likely be liable to the buyer for fraud in the diagram find angle mQR Which situation has a probability of 1/2?A. picking the number 5 from the integers 1 to 10B. rolling an odd number on a fair 6-sided number cube C. randomly choosing the letter s from the word MississippiD. randomly choosing a boy out of a class containing 8 boys and 12 girls The graph of y = e^x is transformed as shown in the graph below. Which equation represents the transformedfunction?