Computer Science, asked by Kunika5675, 9 months ago

Write a program to input 10 numbers in an array and print the even number in it

Answers

Answered by srajfaroquee
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