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
topjm [15]
3 years ago
13

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

.
Computers and Technology
1 answer:
vlabodo [156]3 years ago
3 0

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

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

This checks for odd

<em>        else{            odkount++;        }</em>

   }

This prints the even count

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

This prints the odd count

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

You might be interested in
To enter a typed number into a cell, you press Tab or Backspace?​
muminat

Answer:

bOTH

Explanation:

7 0
3 years ago
Read 2 more answers
Suppose you wanted to run a web server or ftp server from your home. what type of ip address would you want?​
DanielleElmas [232]
COMPUTER IP ADDRESS IS NEEDED TO RUN WEB BROWSER FROM HOME
5 0
3 years ago
HELP asap please... ​
Usimov [2.4K]

Answer:

I have absolutely no idea bruddah.

Explanation:

Soz!

8 0
3 years ago
Explain Importance of flowchart in computer programming
zhuklara [117]

Answer:

Flow charts help programmers develop the most efficient coding because they can clearly see where the data is going to end up. Flow charts help programmers figure out where a potential problem area is and helps them with debugging or cleaning up code that is not working.

creds to study.com (please don't copy it work by word, make sure to paraphrase it. otherwise plagiarism is in the game.)

Explanation:

7 0
2 years ago
Describe how you can use JavaScript to simulate the behavior of the placeholder attribute in older browsers
kirza4 [7]

JavaScript can be used to simulate the behavior of the placeholder attribute in older browsers by using the placeholder attribute which add a placeholder text as a default value and using a different color to differentiate from a color previously entered.

<h3>How are behavior simulated?</h3>

Normally, a user can simulate the behavior of placeholder text in older browsers by setting the value of the value property.

In conclusion, the JavaScript can be used to simulate the behavior of the placeholder attribute in older browsers by using the placeholder attribute which add a placeholder text as a default value and using a different color to differentiate from a color previously entered.

Raed more about JavaScript

<em>brainly.com/question/16698901</em>

6 0
2 years ago
Other questions:
  • The ____ file permission category in unix/linux systems typically entails all permissions and is designated by the letter u.
    7·1 answer
  • Which searching method requires that the list be sorted?
    5·1 answer
  • How many seconds are required to make a left turn and join traffic?​
    11·2 answers
  • Which of the following Google tools support collaboration? Docs Sheets Slides All of the Above
    13·1 answer
  • Which device makes computers that are connected to separate segments appear and behave as if they're on the same segment? (Pleas
    11·1 answer
  • Identify a factor that is unlikely to influence the length of time people wait in the lunch line.
    8·2 answers
  • Consider the relational schema below: Students(sid: integer, sname: string, major: string) Courses(cid: integer, cname: string,
    9·1 answer
  • Write a logical expression using only and, or and not that is equivalent to the Exclusive NOR (XNOR) gate on 2 inputs, called in
    15·1 answer
  • Please help I’ll give 10 points
    6·1 answer
  • A(n) ____________ calculator is a device that assists in the process of numeric calculations but requires the human operator to
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!