//https://[Log in to view URL]
#include <stdio.h>
int main() {
int a[10];
int n;
printf("enter the no of digits :- ");
scanf("%d\n",&n);
for(int i=0;i<n;i++){
scanf("%d",&a[i]);
}
for(int x=1;x<n;x++){// sorts 0-4 and send to y
for(int y=0;y<n-x;y++){// sort 0-3,0-2,0-1,0
if(a[y]>a[y+1]){//sort and if bigger sends last and store then reduce one step
int temp = a[y];
a[y]=a[y+1];
a[y+1]=temp;
}
}
}
for(int i=0;i<n;i++){
printf("%d",a[i]);
}
}
To embed this program on your website, copy the following code and paste it into your website's HTML: