Algorithm

1 Jan 2012

tugas DDP


 Dasar-dasar Pemrograman

Tentang : Fungsi-fungsi String
semoga dapat membantu pemahaman kawan-kawan semua,,,,

#include <cstdlib>
#include <iostream>

using namespace std;

int main(int argc, char *argv[])
{

char kalimat1 [30];
char kalimat2 [30];

cout<<"masukkan kalimat 1 : ";
cin.getline (kalimat1, sizeof(kalimat1));
cout<<"masukkan kalimat 2 : ";
cin.getline (kalimat2, sizeof(kalimat2));

strcpy(kalimat1,kalimat2);
cout<<kalimat1<<endl;

strrev(kalimat2);
cout<<kalimat2;
cout<<endl;\

strlen(kalimat1);
cout<<kalimat1<<endl;

strupr(kalimat1);
cout<<kalimat1<<endl;

strcat(kalimat1,kalimat2);
cout<<kalimat2<<endl;


system("PAUSE");
return EXIT_SUCCESS;
}

Tidak ada komentar:

Posting Komentar