Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int a[6]={5,4,3,2,1,0};
- int n=6;
- int i,j;
- for (i=0; i<n; i++)
- {
- for (j=0; j<n-i; j++)
- {
- if (a[j]>a[j+1])
- {
- int temp;
- temp=a[j];
- a[j]=a[j+1];
- a[j+1]=temp;
- }
- }
- }
- printf("showing sorting order\n");
- for(i=0;i<n;i++)
- {
- printf("%d\n",a[i]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement