#include<stdio.h>
#include<conio.h>
for(i=0;i<10 i="" nbsp="" span="">
scanf("%d",&a[i]);
for(i=0;i<10 i="" span="">
{
for(j=i+1;j<10 j="" span="">
{
if(a[i]>a[j])
{
temp=a[i];
a[i]=a[j];
a[j]=temp;
}
}
}
for(i=0;i<10 i="" span="">
printf(" %d ",a[i]);
printf(" Nos sorted in ascending order\n");
printf("\n");
for(i=9;i>=0;i--)
printf(" %d ",a[i]);
printf(" Nos sorted in descending order\n");
getch();
}10>10>10>10>
No comments:
Post a Comment