Part of a program I am working on needs to output a 4 digit number, in which none of the digits are repeating. i.e 1135 and 1676 are not valid. Also, there can be no "0" in the 4 digit number.
I defined an array:
and am trying to figure out a way to shuffle it and output a[0], a[1], a[2], and a[3].Code:int a ={1, 2, 3, 4, 5, 6, 7, 8, 9}; for(i=0; i<4; i++) printf("%d", a[i]);
All advice is appreciated. Thanks in advance.