cout<<"Elements after sorting out in ascending order."<<endl;
ascendingOrder();
cout<<"Elements after sorting out in descending order."<<endl;
descendingOrder();
mode();
}
int ascendingOrder()
{
for(int y=0;y<5;y++)
{
for(int z=0;z<5;z++)
{
if(arr[y]<arr[z])
{
int Num=arr[y];
arr[y]=arr[z];
arr[z]=Num;
}
}
}
for(int y=0;y<5;y++)
{
cout<<arr[y]<<endl;
}
}
int descendingOrder()
{
for(int y=0;y<5;y++)
{
for(int z=0;z<5;z++)
{
if(arr[z]<arr[y])
{
int Num=arr[z];
arr[z]=arr[y];
arr[y]=Num;
}
}
}
for(int z=0;z<5;z++)
{
cout<<arr[z]<<endl;
}
}
int mode()
{
int tempCount = 1 , mode = 1 , lastNumber = arr[0];