Link List Program Data Structure :: Array

Link List Program Data Structure :: Array Descending

#include<iostream.h>
void main()
{
int a[5],i,j,temp;
for(i=0;i<5;i++)
{
cout<<“Enter a[“<<i<<“]”;
cin>>a[i];
}
for(i=0;i<5;i++)
{
for(j=0;j<4;j++)
{
if(a[j]<a[j+1])
{
temp=a[j];
a[j]=a[j+1];
a[j+1]=temp;
}
}
}
for(i=0;i<5;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.