vendredi 3 juillet 2020

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;




}



Aucun commentaire:

Enregistrer un commentaire