Answer:
import java.util.Scanner;
public class num3 {
public static void main(String[] args) {
char c;
Scanner in = new Scanner(System.in);
c = in.nextLine().charAt(0);
}
}
Step-by-step explanation:
- Using Java Programming language.
- Variable c of type char is declared
- Scanner class is imported to receive user input
- the string method nextLine is used to read an entire line including whitespace
- charAt(0) returns the first character which is assigned to c