#include<iostream>
using namespace std;
int main()
{
int i,j,m,n,k,a[50];
k=50;
cout<<"enter the 50 numbers :"; // bubble sorting of 50 numbers
for(i=0;i<50;i++)
{
cin>> a[i];
}
for(i=0;i<50;i++)
{
for(j=0;j<k;j++)
{
if(a[j]>a[j+1])
{
m=a[j];
a[j]=a[j+1];
a[j+1]= m;
}
}
k--;
}
cout<< "after bubble sorting :";
for(i=0;i<50;i++)
{
cout<< a[i]<< " ";
}
return 0;
}
Labels
Popular Posts
-
BUBBLE SORT : Bubble sort is a simple sorting algorithm ...
-
Binary Tree: A Tree in which each node has a degree of atmost 2. i.e. it can have either 0,1 or 2 children. Here, leaves a...
-
The four pillars of object oriented programming development : 1. Encapsulation : ...
Blog Archive
- March 2017 (1)
- March 2016 (1)
- October 2015 (1)
- September 2015 (1)
- August 2015 (5)
- July 2015 (2)
- June 2015 (4)
- January 2015 (4)
- December 2014 (5)
- November 2014 (1)
- October 2014 (1)
- September 2014 (3)
Powered by Blogger.