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
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");
}
}
}
Comments
Leave a comment