Hi everyone. Before you read this thread, just warning you, you guys might get frustrated because I'm just that bad at programming, so pardon me if I don't really understand whats going on.


What I'm trying just to trying to do some basic stuff, like looping numbers and stuff, so far I got down to rand int's and what I'm trying to do is loop random numbers from 0-1000 (including 0 and 1000). And for every even number, i want it to say even and for every odd number I want it to say odd, and the only way the loop will stop is if the number is divisible by 10 evenly, so like 10, 20, 30, etc.


so far this is what I got,
---------------------------------------------------------
Code:
#include<stdio.h>
#include<stdlib.h>

int main()
{
int x, p;

srand(time(NULL));
x = rand() &#37; 1001;  

// please tell me if this is the right function i should be using for my rand in order for it to be limited from 0 to 1000


while (p != (x / 10) == 0)
{
if(x / 2 == 0)
{printf("The number %d is even.\n", p);
}
else
printf("The number %d is odd.\n", p);
}
----------------------------------------------
And then i have no idea what to do from here.... I don't even know if this is correct, I wrote a flowchart saying that I want and how i want to do it, but its pretty simple for you guys i bet. Sorry that I'm a noob, its just that I really wwant to get into programming because I wanted to program ever since I was 12. Thanks.

-Yi