77 922
Assignments Done
Successfully Done
In August 2019

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]<<" ";

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!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions