Listing Program C++ Huruf Terbalik

#include<iostream.h>
#include<conio.h>
void main()
{
char string [90];
int indeks;

cout<<"masukan suatu string: ";
cin>>string;
cout<<"Nama Setelah di balik: ";
indeks=strlen(string)-1;
while (indeks>=0)
{
cout<<string[indeks];
indeks=indeks-1;
}
cout<<"\n";
getch();
}
Previous
Next Post »