© 2014 Firstsoft Technologies (P) Limited. login
Hi 'Guest'
Home SiteMap Contact Us Disclaimer
enggedu
Quick Links
Easy Studies


C Program To Implement Bubble Sort :

#include void bubble(int a[],int n); int i,j,temp,a[25],n; void main() { clrscr(); printf("\n\nEnter how many numbers you want to sort\n\n"); scanf("%d",&n); printf("\nEnter the numbers \n"); for (i=0;i%d ",i+1); for(j=i+1;j<=n-1;j++) { if(a[i]>a[j]) { temp=a[i]; a[i]=a[j]; a[j]=temp; } } for(k=0;k

SAMPLE INPUT AND OUTPUT:

  Enter how many elements you want to sort

5

Enter the numbers
5
4
3
2
1

PASS->1  1 5 4 3 2
PASS->2  1 2 5 4 3
PASS->3  1 2 3 5 4
PASS->4  1 2 3 4 5

Final sorted list is 1 2 3 4 5

 
SLogix Student Projects

⇓Student Projects⇓
⇑Student Projects⇑
bottom