HTML          
         <p>#include
int main()
{
int i,j,n,a[100],temp;
printf("enter the number of elements");
scanf("%d",&n);
printf("enter the elements\n");
for(i=0;iscanf("%d",&a[i]); 
for(i=0;i{ 
for(j=0;j{ 
if(a[j]>a[j+1])
{
temp=a[j];
a[j]=a[j+1];
a[j+1]=temp;
}
}
}
printf("sorted arry\n");
for(i=0;iprintf("%d\t",a[i]); 
return 0;
}
</p>
Comments
Post a Comment
If you any doubt. Please let me know.