Balik Kata Dengan cara Interaktif

kata_interatif
kata_interatif

 

 

 

 

 

 

 

 

 

 

 

Bentuk Program C++

#include
#include

using namespace std;

class katax{
friend ostream& operator<<(ostream&, katax&);
friend istream& operator>>(istream&, katax&);

public:
katax(){};

void proses(){
panjangkata =kata_Length;
while (!(panjangkata==0))
{
cout << kata(panjangkata) << endl; panjangkata =panjangkata-1;
}

}

private:
char panjangkata[50];
char kata[50];

};

istream& operator>>(istream& in, katax& masukkan){
cout<<“Masukan kata : “<
in >>masukkan.kata;

return in;
}

ostream& operator<<(ostream& out, katax& keluaran){
cout<
return out;
}

int main(int argc, char *argv[])
{
katax huruf;
cin >> huruf;
huruf.proses();
cout<< huruf;
cout<< endl;

system(“PAUSE”);
return 0;
}

Tinggalkan Balasan

Please log in using one of these methods to post your comment:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s