Link List Program Data Structure :: Array

Link List Program Data Structure :: Array :: Ascending

#include<iostream.h>
#define L 0
#define U 5
void main()
{
int a[U],i,j,temp;
for(i=L;i<U;i++)
{
cout<<“Enter a[“<<i<<“]”;
cin>>a[i];
}
for(i=L;i<U;i++)
{
for(j=L;j<U-1;j++)
{
if(a[j]>a[j+1])
{
temp=a[j];
a[j]=a[j+1];
a[j+1]=temp;
}
}
}
for(i=L;i<U;i++)
cout<<“a[“<<i<<“]=”<<a[i]<<endl;
}

Share

About the Author

Akash Padhiyar

Visit Website

There are no comments yet, add one below.

Leave a Comment

Your email address will not be published. Required fields are marked *

*

Time limit is exhausted. Please reload CAPTCHA.