// write a program in c to implement // shorts #include int main(){ int n, temp, i, j, array[30]; printf("Enter array of elements: "); scanf("%d",&n); printf("Enter %d elements: ",n); for(i=0;i=0;i--){ for(j=0;j<=i;j++){ if(array[j]>array[j+1]){ temp=array[j]; array[j]=array[j+1]; array[j+1]=temp; } } } printf("Sorted list in Ascending order:\n"); for(i=0;i
Enter number of elements 7 Enter 7 elements 12 20 3 -2 88 551 9 Sorted list in Ascending order: -2 3 9 12 20 88 551
0 Comments