Answer to Question #269839 in Java | JSP | JSF for Dan

Question #269839

A, e, i, o, u?






by CodeChum Admin









Instructions:








Input







Multiple lines containing a character on each.







c






f






a






Output







Multiple lines containing a character on each.







c






f






a

1
Expert's answer
2021-11-22T09:53:20-0500
import java.util.Scanner;
public class Main
{
	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		int n;
		System.out.println("Enter number of characters to input: ");
		n=in.nextInt();
		
		char [] characters = new char [n];
		System.out.println("Enter chatacters in each line: ");
		for(int i=0;i<n;i++){
		    characters[i]=in.next().charAt(0);
		}
		System.out.println("Enter inputed characters are: ");
		for(int i=0;i<n;i++){
		    System.out.println(characters[i]+"\n");
		}
	}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS