Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

shuffle function in c

#include <stdlib.h>

void shuffle(int arr[], int size){
    srand(time(0));
    for (int i = 0; i < size; i++) {
        int j = rand() % size;
        int t = arr[i];
        arr[i] = arr[j];
        arr[j] = t;
    }
}
 
PREVIOUS NEXT
Tagged: #shuffle #function
ADD COMMENT
Topic
Name
3+4 =