#include<stdio.h>
#include<conio.h>
#include<iostream.h>
void main ()
{
clrscr();
int arr[100];
int b,a,x,z;
printf ("\n PROGRAM BUBBLE SORTING \n");
printf("*---**----*--*----***-----****---*---**----*--*---**----*------*\n\n\n");
for(a=1;a<=10;a++)
{cout<<"Data ke-"<<a<<"=";
cin>>arr[a];}
{printf("\n\nData Sebelum di-Sort\n");
printf("----------------------------------------------------\n"); }
for(a=1;a<=10;a++)
{cout<<" ["<<arr[a]<<"] ";}
for (a=1;a<=10;a++)
{
for (x=1;x<=10-a;x++)
{
if (arr[x]<arr[x+1])
{
z=arr[x];
arr[x]=arr[x+1];
arr[x+1]=z;
}
}
}
printf("\n\n\n\n\nData Setelah di-Sort\n");
printf("====================================================\n");
for (a=1;a<=10;a++)
{printf (" [%d] ", arr[a]);}
printf("\n====================================================\n\n\n\n");
printf(" Composed By :JAYARI/ 10540040\n");
printf(" Terimakasih>>>>>>>\n\n");
printf("Press Anykey to Exit!!");
getch();
}
ohh ternya cuma tanda < dan > doank yg diganti, terimakasih banyak saudara Jayari yg telah memberikan banyak pengajaran kepada kami.
ReplyDeleteoiii PAK MAHOLTRAAAAaaa...
ReplyDelete/n/n/n/n Fungsi nyo ontok apoo ituu..??
( Bingung sambil Garot² Edong )
rahmad: tebalik yang bener \n\n\n\n
ReplyDeleteitu fungsi pindah baris alias enter,kalo \n tiga kali berati turun 3 baris/ enter 3x
terimakasiiiiiiiiiiih komentnya...LOL
anonym:syukron komentnya... xixixixi
ReplyDeleteouhhhh
ReplyDeleteOkeee lahhh..mokasehh bnyakkk...
Galak² mamperrr oii ke Blog aku
Jdi member kek.. LOL :D
rahmad:hahaha la sudah gua jadi member agan... cubo di cek
ReplyDelete