Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
insertionrandom
#include <stdio.h> #include<time.h> #include<stdlib.h> int main() { srand(time(NULL)); int array[100]; int n=100,c,d,position,swap; for ( c = 0 ; c < n ; c++ ) array[c]=rand()%100; for ( c = 0 ; c < ( n - 1 ) ; c++ ) { position = c; for ( d = c + 1 ; d < n ; d++ ) { if ( array[position] > array[d] ) position = d; } if ( position != c ) { swap = array[c]; array[c] = array[position]; array[position] = swap; } } printf("Sorted list in ascending order:\n"); for ( c = 0 ; c < n ; c++ ) printf("%d\n", array[c]); return 0; }
run
|
edit
|
history
|
help
0
Find integer values of functions of integer values
pokus
struktura vzalenost
TVector
TStack_list
TQueue
pointery
struktury ++ vysvětlivky
BPC UDP cv10 cisla
Check Expression with Stack