/* * srand.c */ #include #include #define MAX 10 int main(void) { int num; num=rand(); printf("\nrand alone is: %d\n", num); num=num%MAX; srand(1); num=rand(); printf("rand after srand(1) is: %d\n", num); num=num%MAX; printf("Modulus of number/10 is: %d\n\n", num); srand(2); num=rand(); printf("rand after srand(2) is: %d\n", num); num=num%MAX; printf("Modulus of number/10 is: %d\n\n", num); srand(47931); num=rand(); printf("rand after srand(47931) is: %d\n", num); num=num%MAX; printf("Modulus of number/10 is: %d\n\n", num); srand(1); num=rand(); printf("rand after srand(1) is: %d\n", num); num=num%MAX; printf("Modulus of number/10 is: %d\n\n", num); return 0; }