Computer Science, asked by jrdsinha4, 1 year ago

Enter 50 number in an array to print all the even numbers

Answers

Answered by anitamitramadhu
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
jrdsinha4: I want the simple programme for array
anitamitramadhu: in which programming language?
Answered by trishitakesarwani
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