#include <iostream> using namespace std; int main() { int a[5],i,j,t; cout<<"\nEnter five elemnts:"; for(i=0;i<5;i++) cin>>a[i]; for(i=0;i<5;i++) for(j=i+1;j<5;j++) if(a[i]>a[j]) { t=a[i]; a[i]=a[j]; a[j]=t; } cout<<"\n Ascending order\n"; for(i=0;i<5;i++) cout<<a[i]<<"\n"; cout<<"\n Descending order\n"; for(i=4;i>=0;i--) cout<<a[i]<<"\n"; return 0; }