View Code of Problem 75

#include <stdio.h>
#include <stdlib.h>

/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char *argv[]) {
    int i,j,a[100],t;
    for(i=0;i<10;i++){
    	scanf("%d",&a[i]);
	}
	for(i=0;i<10;i++){
		for(j=i+1;j<10;j++){
			if(a[i]>a[j]){
				t=a[i];
				a[i]=a[j];
				a[j]=t;
			}
		}
	}
	for(i=0;i<9;i++){
		printf("%d\n",a[i]);
	}
	printf("%d",a[i]);
	return 0;
}

Double click to view unformatted code.


Back to problem 75