import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int[] arr = new int[9];
int[] rez = new int[9];
for (int i = 0; i < arr.length; i++) {
System.out.print("Car " + (i + 1) + ": ");
arr[i] = in.nextInt();
}
int x = 0;
for (int i : arr) {
if(i%2 == 0){
rez[x] = i;
x++;
}
}
for (int i : arr) {
if(i%2 != 0){
rez[x] = i;
x++;
}
}
for (int i : rez) {
System.out.print(i + " ");
}
}
}
This is the code i want pseudocode and flowchart of this code.
The answer to your question is provided in the image:
Comments
Leave a comment