#include<iostream.h>
#include<conio.h>
#include<string.h>
void main()
{
char kata[100];
char *p_array;
int i, j;
#include<conio.h>
#include<string.h>
void main()
{
char kata[100];
char *p_array;
int i, j;
cout<<"=================================\n";
cout<<"= =\n";
cout<<"= PROGRAM PEMBALIK KATA =\n";
cout<<"= =\n";
cout<<"=================================\n";
cout<<endl;
cout<<endl;
cout<<"kata yang pengen dibalik --->> ";
cin>>kata;
cout<<endl;
cout<<"..................................................";
cout<<endl;
cout<<endl;
cout<<"dirimu input kata : ";
j = strlen(kata);
p_array = kata;
for(i=0; i<j; i++)
{
cout<<*p_array;
p_array++;
}
cout<<endl;
cout<<endl;
cout<<"kalo dibalik jadi : ";
for(i=0; i<j; i++)
{
p_array--;
cout<<*p_array;
}
cout<<endl;
getch();
}
0 komentar:
Posting Komentar