This is for Java Programming
In my code, I'm missing a new line at the end of an array. I'm not sure how to do this. I get the correct output but am missing a newline at the end. Please see attached image for clarity. My code is below.
import java.util.Scanner;
public class LabProgram {public static void main(String[] args) {Scanner scnr = new Scanner(System.in);int[] array=new int[20];int n;int a;int i;n=scnr.nextInt();for(i = 0; i < n;="">array[i]=scnr.nextInt();a=scnr.nextInt();for(i = 0; i < n;="">{if(array[i]<>System.out.print(array[i] + " ");}}}
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here