Balloon Sorting program of C++


                                   Balloon Sorting

#include <conio.h>
#include<iostream.h>

   
void inarry(int arry[],int size)
{
cout<<"enter the element of Arry"<<endl;
int e;   
for(e=0;e<size;e++)
{

cin>>arry[e];
   
}

   
}
   
int main ()
{
cout<<"                    Balloon Sorting program of C++"<<endl<<endl;   
int size;
cout<<"enter the size of arry"<<endl;
cin>>size;   
int a[size],e,temp,j;   
inarry(a,size);
for(j=0;j<size;j++)
{
   

for(e=j;e<size-1;e++)
{
if(a[j]>a[e+1])
{
temp=a[j];
a[j]=a[e+1];
a[e+1]=temp;
   
}
}
   
}
cout<<"Arrange Arry is "<<endl;
for(e=0;e<size;e++)
{
cout<<a[e]<<endl;   
   
}
}

                                        <<<<<                                                >>>>>>                             
Share on Google Plus

About Unknown

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment

Powered by Blogger.

Translate

 
 
.