contoh C++

Posted: May 10, 2011 in Bahasa C++

Masukkan kalimat, kemudian tampilkan kalimat tersebut dimulai dari urutan yang paling belakang (terbalik).
Contoh = Hallo -> ollaH

CODING:
=========================================================
#include
#include
#include
using namespace std;
void balik (char *karakter);
void main()
{
clrscr();
char kalimat[100];
cout << “\nMasukkan kata
: “;
cin.getline (kalimat, 100);
balik(kalimat);
getch();
}void balik (char *karakter)
{
int s;
s=strlen(karakter);
cout <=0; n–)
{
cout << *(karakter+n);
}
}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s