write a program 10 numbers in an array and print the first all odd numbers then all even numbers
Answers
Answered by
1
Answer:
Java Program to Print the Odd & Even Numbers in an Array
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++)
Explanation:
Similar questions