vendredi 30 juin 2023

Why does it give same result (I am a beginner) [duplicate]

I kept on getting 84 in the response for some reason. C++ kept on choosing 84 randomly! Do you have a idea why this is happening. (Also, please please do not shut down this question, I need help!) Some c++ code below

#include <bits/stdc++.h>
using namespace std;

int main()
{
int choice=1+(rand()%100);
cout<<choice;
}

I kept on seeing 84! Why did it choose 84 all the time ?!




Aucun commentaire:

Enregistrer un commentaire