Answer to Question #149455 in C++ for Jochelle Buenaventura

Question #149455
Create a program using two-dimensional arrays that determines the even numbers among the twelve input values from the keyboard and prints the list of these Even numbers.
Note:
3 rows, 4 columns
1
Expert's answer
2020-12-10T07:49:55-0500
#include <iostream>
using namespace std;


int main() {
    int numbers[3][4];


    cout << "Enter numbers: " << endl;
    for (int i = 0; i < 3; ++i) {
        for (int j = 0; j < 4; ++j) {
            cin >> numbers[i][j];
        }
    }


    cout << "The  even numbers are: ";
    for (int i = 0; i < 3; ++i) {
        for (int j = 0; j < 4; ++j) {
                if  (numbers[i][j]%2 == 0){
                     cout << numbers[i][j] << " ";
                }


        }
    }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog