embeddedlover
Full Member level 5
#include<stdio.h>
#include<stdlib.h>
main()
{
int x = rand() % 25;
printf("%d",x);
}
I am using rand() function and it always gives me a output of 16.
Please give me the reason.
As per my knowledge a rand() generates random number based on system clock. But if i load to micro controller on what basis is it generating a random number?
#include<stdlib.h>
main()
{
int x = rand() % 25;
printf("%d",x);
}
I am using rand() function and it always gives me a output of 16.
Please give me the reason.
As per my knowledge a rand() generates random number based on system clock. But if i load to micro controller on what basis is it generating a random number?