#include <stdio.h>
int main()
{
int a[100],i,j,n,b;
printf("\nEnter the limit : ");
scanf("%d", &n);
printf("\nEnter the values : ");
for(i=0;i<n;i++)
{
scanf("%d", &a[i]);
}
for(i=0; i<n; i++)
{
for(j=i+1; j<n; j++)
{
if(a[i]>a[j])
{
b=a[i];
a[i]=a[j];
a[j] = b;
}
}
}
for(i=0;i<n;i++)
printf("\n%d",a[i]);
return 0;
}
Comments
Post a Comment