#include<iostream>
#include<conio.h>
using namespace std;
int main()
{ int i,j,temp,n;
cout<<"Enter the size of array";
cin>>n;
int a[n];
cout<<"Enter the elements of array"<<endl;
for(i=0;i<n;i++)
{
cin>>a[i];}
for(i=0;i<n;i++)
{
for(j=0;j<n;j++)
{
if(a[i]<a[j])
{
temp = a[i];
a[i] = a[j];
a[j] = temp;}
}
}cout<<"Array in ascending order"<<endl;
for(i=0;i<n;i++)
cout<<a[i]<<endl;
getch();
}
This comment has been removed by the author.
ReplyDeleteThis comment has been removed by the author.
ReplyDeletegood job.I haven't gone through the code thoroughly but it shows your hard work keep it up.welldone
ReplyDeletethank you...
DeleteAdfly hehe
ReplyDelete