History, asked by vaishnavi635, 6 months ago

write a java program to print all even numbers between 1 to n ( take n as input)​

Answers

Answered by mdniaz9193
3

Answer:

public class Even_Odd.

int n;

Scanner s = new Scanner(System.

System. out. print("Enter no. of elements you want in array:");

n = s. nextInt();

int a[] = new int[n];

System. out. println("Enter all the elements:");

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

Hope this answer helpful for you

Similar questions