Get paid to share your links!

Program Pembalik Kata dengan Array C++

Saturday, March 9, 2013

Kompiler : Borland C++
Algoritma :

  1. Start
  2. Cek huruf pertama hingga akhir huruf
  3. Cek kembali huruf dari terakhir hingga pertama dan tukar tempat
  4.  Tampilkan kata balikan dari hasil penukaran huruf
  5.  End 
Script
#include<iostream.h>
#include<conio.h>

void main()
{
char kata[20];
int x=0,s=0;
   cout<<"\t*****************************\n";
   cout<<"\t*                           *\n";
cout<<"\t*   Program Membalik Kata   *\n";
   cout<<"\t*                           *\n";
   cout<<"\t*****************************\n\n";
   cout<<"Masukkan kata yang ingin dibalik ! [maks 20]\n";
   cin>>kata;

while (kata[x]!='\0')
{
x++;
}

cout<<"\n";
   cout<<s;
   s=1>5 && 4<5;
cout<<"\nHasil pembalikan : ";

while (x!=0)
{
cout<<kata[x-1];
x--;
}
getch();
}
Share this article :

0 comments:

Speak up your mind

Tell us what you're thinking... !

Followers

 
Support : Creating Website | Johny Template | Mas Template
Copyright © 2011. Blog - All Rights Reserved
Template Created by Creating Website Inspired by Sportapolis Shape5.com
Proudly powered by Blogger