Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - C language defines an integer array with the length of 10. For grammar?
C language defines an integer array with the length of 10. For grammar?
# include & ltstdio.h & gt

void sort(int arr[],int len){

int i,j;

int temp = 0;

for(I = 0; I< len-1; i++){

for(j = 0; j & ltlen- 1-I; j++){

if(arr[j]& gt; arr[j+ 1]){

temp = arr[j];

arr[j]= arr[j+ 1];

arr[j+ 1]= temp;

}

}

}

}

void printArr(int arr[],int len){

int I;

for(I = 0; I & ltleni++)

printf("%d ",arr[I]);

printf(" \ n ");

}

int main(){

int arr[ 10]= {2 1,45,38,66,73, 14,55,99,85, 10 };

printArr(arr, 10);

sort(arr, 10);

printArr(arr, 10);

Returns 0;

}