#include<stdio.h>
#include<conio.h>
//Main function
void main()
{
int i,a[10],n,j,temp;
clrscr();
printf("\nEnter the size of array:");
scanf("%d",&n);
printf("\n\nEnter the elements into array:");
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
printf("\nEntered array: ");
for(i=0;i<n;i++)
{
printf("%d\t",a[i]);
}
for(i=0;i<n;i++)
{
for(j=0;j<n;j++)
{
if(a[j]>a[i])
{
temp=a[i];
a[i]=a[j];
a[j]=temp;
}
}
}
printf("\n\nSorted list: ");
for(i=0;i<n;i++)
{
printf("%d\t",a[i]);
}
getch();
}//end of main
/*Output
Enter the size of array:7
Enter the elements into array:12 88 5 100 32 77 50
Entered array: 12 88 5 100 32 77 50
Sorted list: 5 12 32 50 77 88 100 */
Pankaj Gaikar is a
professional blogger
from Pune, India who writes on Technology, Android,
Gadgets, social media and latest tech updates at
Punk Tech
,
Being Android
&
Shake The Tech
. Email me
HERE
Bet365 casino site | Review of the best online casinos in
ReplyDeleteBet365 Casino luckyclub is a very popular and widely available online casino, which is a top online gambling site. They have a large selection of slots,