I'm trying to generate a program that generates numbers between 1 and 1000 and then prints out if it is prime or not. I tried using randomize but it didn't work. I get an error message that says "too few arguments to function (srand)".
here is the code I have so far.
Code:#include<stdio.h> #include<stdlib.h> #include<time.h> int prime(int n) { int i; int n; randomize(); i = srand(); for(i = 2; i < 1000; i++){ if ( n%i == 0 && i != n) return 0; } return 1; } int main() { int n: n = prime(n); printf("%d\n", n); return 0; }