Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdlib.h>
- #include <stdio.h>
- void ordenaVetor(float arr[7]){
- for (int u=0; u<=6; ++u)
- for (int i = 0; i < 7; i++){
- float aux = 0;
- if (arr[i-1] > arr[i]){
- aux = arr[i-1];
- arr[i-1] = arr[i];
- arr[i] = aux;
- }
- }
- };
- int main(){
- float array[7] = {12,99,37,6,9,9.5,8};
- ordenaVetor(array);
- for (int i=0; i < 7; ++i)
- printf(" %4.2f, ", array[i]);
- return 0;
- }
Add Comment
Please, Sign In to add comment