Enter 50 number in an array to print all the even numbers
Answers
Answered by
0
import java.utili.*;
class Even
{
public void main ()
{
Scanner sc=new Scanner(System.in);
int i;
int a []=new int [50];
for (i=0; i<50; i++)
{
System.out.println ("Enter array elements ");
a [i]=sc.nextInt();
}
System.out.println("Even numbers are:");
for(i=0; i <50; i++)
{
if(a[i]%2==0)
System.out.println(a[i]);
}
}
}
jrdsinha4:
I don't want this programme
Answered by
0
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int a[50],i;
cout<<"enter numbers \n";
for(i=1;i<=50;i++)
{
cin>>a[i];
}
for(i=1;i<=50;i++)
{
if(a[i]%2==0)
cout<<a[i];
}
getch();
}
Similar questions