J
John Cassidy
This has been driving me crazy. I've done basic C in school, but my
education is mainly based on object oriented design theory where Java
is our tool. For some reason, while helping a friend with a C
Programming lab. I cannot for the life of me generate a random number.
i don't know what is wrong. please help.
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define RAND_MAX 32768
int main(void)
{
float b;
b = ((float)rand()/RAND_MAX);
printf("Random Number: %f", b);
system("PAUSE");
return 0;
}
education is mainly based on object oriented design theory where Java
is our tool. For some reason, while helping a friend with a C
Programming lab. I cannot for the life of me generate a random number.
i don't know what is wrong. please help.
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define RAND_MAX 32768
int main(void)
{
float b;
b = ((float)rand()/RAND_MAX);
printf("Random Number: %f", b);
system("PAUSE");
return 0;
}