Q:

The code is required to make a random number then keepon spouting random numbers until it reaches that number, but its always the same

Here's the idea of the code: The code is required to make a random number then keepon spouting random numbers until it reaches that number, but its always the same.
heres the code:
#include <stdio.h>
#include <math.h>

int rdt () {
long long int randomonium;
randomonium=rand();
return randomonium;
}
int main (){
int rd;
int no;

while(1){
rd=rand();
printf("%d\n", rd);
if (rd== rdt()){
    break;

}
}
return 0;

}

A:

You can put a srand(time(NULL)); just before the while to change the random seed used by rand().
Don't forget to include time.h in the code.

