Created
May 27, 2016 20:56
-
-
Save PedroHLC/2070704e696e33090c5731a32cd6516f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() { | |
int exemplo[] = {9, 8, 7, 6, 5, 4, 3, 2, 1, 0}, x, y, aux; | |
for(y=0; y < 9; y++) { | |
for(x = 0; x < 9; x++) | |
if(exemplo[x] > exemplo[x+1]) { | |
aux = exemplo[x]; | |
exemplo[x] = exemplo[x+1]; | |
exemplo[x+1] = aux; | |
} | |
for(x = 0; x < 10; x++) | |
printf("%d ", exemplo[x]); | |
printf("\n"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment