Write a program to input 10 numbers in an array and print the even number in it
Answers
Answered by
3
Note: I am using C++ language.
#include<iostream>
using namespace std;
int main (){
int A[10];
cout<<"Enter your array elements:\n";
for(int i=0 ; i<10;i++){
cin>>A[i];
}
cout<<"\nThe array contains: " ;
for(int i=0 ; i<10;i++){
cout<<A[i] <<" ";
}
cout<<"\nThe Even elements are : ";
for(int i=0 ; i<10;i++){
if (A[i]%2==0) cout<<A[i] <<" ";
}
return 0;
}
**Please mark this answer as Brainliest answer!!
Similar questions
Business Studies,
4 months ago
Computer Science,
4 months ago
Social Sciences,
4 months ago
Computer Science,
9 months ago
Physics,
1 year ago
Physics,
1 year ago
India Languages,
1 year ago