say we have,
int a[]=int a[5];
how do we fill 5 elements i.e 1,2,3,4,5 randomly in a[i](where i=0..4). using for loop.
example
a[0]=4
a[1]=2;
a[2]=3;
a[3]=5
a[4]=1
I was practicing arrays. I came up with this thought but i couldn't figure it out. I can fill random number using for loop, but random number generates duplicate number.I was trying to figure out without duplicate number..
Thank you