Whenever I run this code, I get a same result.
Program
#include
int main(int agrc, const char *argv[]) {
int i = rand();
printf(\"
Just to add to Yacoby's answer - I was slightly surprised that it didn't default to a time-based seed, so I looked up the man page:
If no seed value is provided, the rand() function is automatically seeded with a value of 1.
So if you change your code to use seed(1) you should still see the same output - but seed(time()) will make it change each time.