when this exicutes i just keep getting 22 as number instead of another number. can some one help mePHP Code:
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
int random(int num);
main()
{
while(1)
{
int timer = time(NULL);
int variable[100];
int i=0, j=0;
sleep(1);
srand(timer);
variable[i] = random(23);
printf("Random #: %d\t", variable[i]);
scanf("%f", &variable);
}
return;
}
int random(int num)
{
return((rand()/(RAND_MAX+1.0))*num);
}