We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 53ced77 commit f0c9275Copy full SHA for f0c9275
piglatinWord,java
@@ -0,0 +1,33 @@
1
+import java.util.Scanner;
2
+
3
+public class KboatPigLatin
4
+{
5
+ public static void main(String args[]) {
6
7
+ Scanner in = new Scanner(System.in);
8
+ System.out.print("Enter word: ");
9
+ String word = in.next();
10
+ int len = word.length();
11
12
+ word=word.toUpperCase();
13
+ String piglatin="";
14
+ int flag=0;
15
16
+ for(int i = 0; i < len; i++)
17
+ {
18
+ char x = word.charAt(i);
19
+ if(x=='A' || x=='E' || x=='I' || x=='O' || x=='U')
20
21
+ piglatin=word.substring(i) + word.substring(0,i) + "AY";
22
+ flag=1;
23
+ break;
24
+ }
25
26
27
+ if(flag == 0)
28
29
+ piglatin = word + "AY";
30
31
+ System.out.println(word + " in Piglatin format is " + piglatin);
32
33
+}
0 commit comments