write a java program to print all even numbers between 1 to n ( take n as input)
Answers
Answered by
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
Math,
3 months ago
Political Science,
3 months ago
Social Sciences,
3 months ago
Math,
6 months ago
Physics,
11 months ago