63 132
Assignments Done
99,1%
Successfully Done
In July 2018

Answer to Question #3322 in C++ for mukunda

Question #3322
Take N numbers in an array; print all even numbers and odd numbers separately.
Expert's answer
#include <iostream>
using namespace std;

int main()
{
const int N = 5;
int arr[N] = { 10, 46, 37, 8, 19 };

cout << "Even numbers: ";
for (int i = 0; i < N; ++i)
& if (arr[i] % 2 == 0)
& cout << arr[i] << " ";
cout << endl;

cout << "Odd numbers: ";
for (int i = 0; i < N; ++i)
& if (arr[i] % 2 == 1)
& cout << arr[i] << " ";
cout << endl;

return 0;
}

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 first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions