HELP PLEASE TO RESOLVE THE EXERCISE
Code:
/*
Description: Extract Casual 100 Numbers .... but make a programme in which an already extracted Numer W'ont repeat.
*/
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <time.h>
int main (){
int N=100;
int num[N];
int i;
//inizio algortimo
srand((unsigned)time(NULL));
num[0]=1;
num[99]=100;
for(i=0;i<N;i++){
num[N]=rand()%(num[99]-num[0]+1)+num[0]; /*Formula for extracting Casual(random) Numbers with the biggest and smalletst value included */
printf("\n%d : %d",i,num[N]);
N++;
}
printf("\n\n\n");
//system("pause");
getch();
}
im trying first to extract 100 random (Casual ) numbers .... extracted by PC ... but after extracted 7 numbers the programme .. gives me the error ... like in this picture -->
please help me to solve this problem .... and at last tell me how to do that the same number wont repeat in the extracted numbers ...
This is my first exercize with the Arrays ... and im not able to do it .. plz help