63 845
Assignments Done
99,2%
Successfully Done
In August 2018

Answer to Question #12755 in C++ for Emmanuel

Question #12755
a program that accepts 20 numbers from a user and displays all the numbers and also the even numbers included
Expert's answer
#include <iostream.h>

bool even(int i){
if (i%2==0) return true;
else return false;
}

int arr[20];
int i;

void main(){
for (i=0;i<20;i++){
& cout<<"enter a number: ";
& cin>>arr[i];
}
cout<<"\nHere are all entered numbers:\n";
for (i=0;i<20;i++){
& cout<<arr[i]<<" ";
}
cout<<"\n\nHere are entered even numbers:\n";
for (i=0;i<20;i++){
& if (even(arr[i])) cout<<arr[i]<<" ";
}
cout<<"\n\n";
}

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