Dsa
Strings
Easy
Shift Vowels
You are tasked with writing a function that takes a string as input and shifts all vowels to the right by one position within the same string. Vowels are defined as 'a', 'e', 'i', 'o', 'u' (case insensitive). For example, the input 'hello' would become 'holle', and 'beautiful' would become 'beutifal'. Other characters should remain unchanged and the function should maintain the case of the letters.
Input: A single line string S (1 ≤ |S| ≤ 100).
Output: The transformed string with vowels shifted.
Example:
Input:
hello
Output:
holle
Key concepts
stringsmanipulationvowels
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now