Exercise
Char
Objetive
Write a program to ask the user for three letters and display them in reverse order.
Example Code
import java.util.*;
public class Main
{
public static void main(String[] args)
{
char letter, letter2, letter3;
System.out.print("Enter letter: ");
letter = (char)new Scanner(System.in).nextLine();
System.out.print("Enter letter: ");
letter2 = (char)new Scanner(System.in).nextLine();
System.out.print("Enter letter: ");
letter3 = (char)new Scanner(System.in).nextLine();
System.out.printf("%1$s %2$s %3$s" + "\r\n", letter3, letter2, letter);
}
}