Memisahkan Huruf Vocal dan Konsonan C# Posted by Unknown on February 22, 2015 Get link Facebook X Pinterest Email Other Apps using System; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace memisahkan_huruf_Vocal_dan_Konsonan { class Program { static void Main(string[] args) { String kalimat; Console.Write("Input Kalimat : "); kalimat = Console.ReadLine(); Console.WriteLine(); Console.Write("Huruf Vocal = "); for (int i = 0; i < kalimat.Length; i++) { if (kalimat[i] == 'A' || kalimat[i] == 'a' || kalimat[i] == 'E' || kalimat[i] == 'e' || kalimat[i] == 'I' || kalimat[i] == 'i' || kalimat[i] == 'U' || kalimat[i] == 'u' || kalimat[i] == 'O' || kalimat[i] == 'o') { Console.Write(kalimat[i] + " "); } } Console.WriteLine(); Console.Write("Huruf Konsonan = "); for (int i = 0; i < kalimat.Length; i++) { if (kalimat[i] == 'A' || kalimat[i] == 'a' || kalimat[i] == 'E' || kalimat[i] == 'e' || kalimat[i] == 'I' || kalimat[i] == 'i' || kalimat[i] == 'U' || kalimat[i] == 'u' || kalimat[i] == 'O' || kalimat[i] == 'o') { continue; } else { if (char.IsWhiteSpace(kalimat[i])) { continue; } else { Console.Write(kalimat[i] + " "); } } } Console.ReadKey(); } } } Comments
Comments
Post a Comment