Contoh program sederhana untuk balik Teks menggunakan C#....
using System;
using System.Collections.Generic;
using System.Text;
namespace HelloWorld
{
class Program
{
static void Main(string[] args)
{
Console.Out.WriteLine("\n");
Console.Out.WriteLine("###Program Balik Teks Sederhana###\n");
Console.Out.Write("Masukkan Teks : ");
char[] Hasil = Console.In.ReadLine().ToCharArray();
Console.Out.Write("Balik Teks : ");
for (int i = Hasil.Length - 1; i >= 0; i--)
{
Console.Out.Write("{0}", Hasil[i]);
}
Console.ReadKey();
}
}
}
No comments:
Post a Comment