Word: 'trouble'
First vowel encountered: 'o'
Therefore, the Piglatin version: 'oubletray'
(From the first vowel till the last letter, concatenated with the first few letters which(or were not) left out, which concatenated with a standard 'ay')
So, the Piglatin form of 'sravya1224' would be: 'avya1224sray'
First vowel encountered: 'o'
Therefore, the Piglatin version: 'oubletray'
(From the first vowel till the last letter, concatenated with the first few letters which(or were not) left out, which concatenated with a standard 'ay')
So, the Piglatin form of 'sravya1224' would be: 'avya1224sray'
import java.io.*;
class piglatinWord
{
static void pig()throws IOException
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter the word for which you want to get the piglatin form of:n");
String s=br.readLine();
int l=s.length(),n=0;
String s1="";
for(int j=0;j<l;j++)
{
char c=s.charAt(j);
if(c=='a'||c=='e'||c=='i'||c=='o'||c=='u')
{
s1=s.substring(j);
s1=s1+(s.substring(0,j));
break;
}
}
s1=s1+"ay";
System.out.println("The pig latin form of the word: '"+s+"' is: '"+s1+"'");
}
}