View Code of Problem 75

#include<stdio.h>
#include<string.h>
#include<math.h>
int main(){
    int a[100],i,j,min,temp;

    for(i=0;i<10;i++){
        scanf("%d",&a[i]);
    }
    for(i=0;i<9;i++){
        min=i;
        for(j=i;j<10;j++){
                if(a[j]<a[min]){
                    min=j;
                }
        }
        temp = a[i];
        a[i] = a[min];
        a[min]=temp;
    }
    for(i=0;i<10;i++){
       printf("%d\n",a[i]);
    }
    return 0;

}

Double click to view unformatted code.


Back to problem 75