Dec
28
2008
28
2008
C++ Program for Bubble sort
C++ Program for Bubble sort.
/************************************************************** Author: Arun Vishnu M V Web: www.arunmvishnu.com Description: C++ Program for Bubble sort ***************************************************************/ #include<iostream.h> #include<conio.h> void main() { int array[100],n,i,j,temp; clrscr(); cout<<"How many numbers--> "; cin>>n; cout<<"Enter "<<n<<" numbers\n"; for(i=0;i<n;i++) cin>>array[i]; for(i=0;i<n;i++) { for(j=0;j<n-1;j++) if(array[j]>array[j+1]) { temp=array[j]; array[j]=array[j+1]; array[j+1]=temp; } } cout<<"\nArray is sorted in ascending order.\n"; for(i=0;i<n;i++) cout<<array[i]<<" "; getch(); }
Related Posts
Latest Posts
- Your Facebook account hacked? Here’s how to fix it
- Indian Railway Enabled VRM System to travel without the printout of e-ticket
- Amazon Launches $199 Kindle Fire Android Tablet
- Download Windows 8
- How to change APN settings in iPhone iOS Beta 7
- Steve Jobs Resigns as CEO of Apple
- How to open camera app when the iPhone is locked?
- Firefox 5 released
- Download Firefox 4
- How to run Turbo C IDE on Windows 7
Tags
apple
c and cpp
Cheats
download
downloads
Entertainment
error
Film
friendship
Fun
gadgets
Games
gmail
google
greetings
india
Internet
iphone
java script
linux
love
mac
microsoft
mobile
News
office
onam
Personal
photos
Programming
review
Security
software
source code
technology
Tips & Tricks
video
videos
virus
web
web development
windows
windows 7
worm
yahoo

An article by
thank u.how create this programme with using read display function.
thanks for solving my problem that program is very hlpful for understanding the bubble sort
thank u so much… its a grt help for d beginners in cpp……..