so, for this assignment they introduce the rand() function and also(finally) other libraries to use. anyway, the first program is as follows:
Write a program that will print out 10 random integers between 10 and 25. Prompt the user to enter the seed from which the random sequence will grow.
i used an example out of my text, but naturally it didn't work. i also asked my t.a.'s about it and they didn't know how to do it either. this left me thrilled. anyway, i was wondering what anybody thought of this.
Code:#include <stdio.h> #include <stdlib.h> int main() { int x, i,z; printf("Enter a number between 10 & 25.\n"); scanf("%d", x); printf("10 random numbers between values are as follows:\n"); for(i=0; i<10; i++) { z=10 + (srand(x) % 25); printf("%d\n", z); } return 0; }