Computer Science, asked by aditimondal09, 6 months ago

WAP to input n elements in an array and print only the even elements

Answers

Answered by shahana26
3

ANSWER :

#include<iostream>

using namespace std;

int main()

{

int n;

cin>>n;

int arr[n];

for(int i=0; i<n; i++)

{

cin>>arr[i];

}

for(int i=0; i<n; i++)

{

if(arr[i] % 2 == 0)

cout<<arr[i];

}

return 0;

}

//Mark my answer as "brainliest" and follow me, thanks :)

Similar questions