#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#include <time.h>
// Program to generate random numbers, using an array
int main() {
int arr[50];
int i;
srand((unsigned int)time(NULL));
for (i = 0; i < 50; i++)
{
arr[i] = rand() % 50;
printf("arr[%d] = %d\t", i, arr[i]);
}
_getch();
return 0;
}
I'm getting this warning:
(12): warning C4244: 'function': conversion from 'time_t' to 'unsigned int', possible loss of data.
timefunction. - Some programmer dude0to49(inclusive). Not that you need an array in the code you show, really. - Some programmer dude