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