Given a lowercase character, write a program that prints the next character in the alphabet. If the input character is 'z', print 'a'. Input: A single lowercase character. Output: The next character in the alphabet after the input character.
Characters
Next character in alphabet
Report a typo
Sample Input 1:
aSample Output 1:
bSample Input 2:
mSample Output 2:
nWrite a program in Java 25
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
// Read the input character
char inputChar = scanner.next().charAt(0);
// TODO: Write your code here
// Print the result
System.out.println(outputChar);
}
}
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.