Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /bin/awk
- BEGIN{
- printf("Enter the number of terms: ");
- getline n;
- printf("Enter the elements.\n");
- for(i=0; i<n; i++) getline a[i];
- for(i=0; i<n; i++)
- for(j=i+1; j<n; j++)
- if(a[i]>a[j]){
- temp=a[i];
- a[i]=a[j];
- a[j]=temp;
- }
- for(i=0; i<n; i++) printf("%d", a[i]);
- }
- #Save as bSort.awk, run by typing awk -f bSort.awk
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement