Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C++ program that does the following: Creates a 10-element array (either as a local variable or dynamic memory). Fills the array with random

Write a C++ program that does the following:

Creates a 10-element array (either as a local variable or dynamic memory).

Fills the array with random integers between 1 and 100 inclusive

Counts the number of even integers in the array.

Prints to the console:

The contents of the array

Number of even and odd numbers (if a number is not even, it is odd).

Compile and run this program. Your output should look similar to this:

Array contents: 10 18 92 4 93 41 2 98 53 6 This array has a total of 3 odd items and 7 even items.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Filing And Computer Database Projects

Authors: Jeffrey Stewart

2nd Edition

007822781X, 9780078227813

Students also viewed these Databases questions

Question

1. Are my sources credible?

Answered: 1 week ago

Question

3. Are my sources accurate?

Answered: 1 week ago

Question

1. Is it a topic you are interested in and know something about?

Answered: 1 week ago