Search
 
SCRIPT & CODE EXAMPLE
 

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;
    }
}
Comment

PREVIOUS NEXT
Code Example
C :: how to map one value to another in C 
C :: c program to find area of circle 
C :: C hello workld 
C :: same project on different monitor in intellij mac 
C :: if statement shorthand c 
C :: how to auto run something on cmd 
C :: data types in c 
C :: Write a C program to find reverse of an array 
C :: windeployqt example 
C :: arduino client disconnect 
C :: print ascii value in c 
C :: how to get add to number C 
C :: exclamation mark in c 
C :: va_list in c 
C :: function for quicksort in c 
C :: addition in c 
C :: how to pass an array of structs as an argument in c 
C :: Area of a Circle in C Programming 
C :: bash while loop n times 
C :: what is syntax in programming 
C :: prime number c program 
C :: prime factorization of factorials using c 
C :: why there is return 0 used in c 
C :: c check if character is an alphabet 
C :: c remove last charachter from string 
C :: c median of array 
C :: c program to implement mv command 
C :: c memcpy 
C :: command args c 
C :: what is the use of malloc in c 
ADD CONTENT
Topic
Content
Source link
Name
9+9 =