You are on page 1of 3

Source code:

#include<stdio.h>
#include<conio.h>
main()
{
int a[20],i,j,t;
clrscr();
printf("Enter how many number will be entered:");
for(i=0;i<20;i++)
{
scanf("%d",&a[i]);
}
for(i=0;i<19;i++)
{
for(j=i+1;j<20;j++)
{
if(a[i]<a[j])
{
t= a[i];
a[i]=a[j];
a[j]=t;
}
}
} for(i=0;i<20;i++)
{

printf("\t%d",a[i]);
}
}

Output:
Enter the values:45
75
89
45
477
522
45
215
225
45
54
45
Highest:
544
45
78
75
45
45
34

You might also like