#include<iostream.h>
#include<conio.h>
int main()
{ int a[10],temp,bak;
cout<<" enter the elements "<<endl;
for(int i=0;i<5;i++)
cin>>a[i];
int m=a[0];
for(int j=0;j<5;j++)
{
if(a[j]>a[j+1])
{
temp=a[j];
a[j]=a[j+1];
a[j+1]=temp;
}
}
cout<<endl;
for(int k=0;k<5;k++)
{
cout<<a[k]<<endl;
}
getch();
}
sahil_logic 0 Light Poster
SpS 34 Posting Pro
dwks 149 Posting Whiz in Training
SpS 34 Posting Pro
dwks 149 Posting Whiz in Training
perniciosus 19 Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.