- 4
Give me compliments about my first program.
Helps in playing dice game.It creates random number exactly same as we play real game. https://code.sololearn.com/cuqZyraS131s/?ref=app
8 Respuestas
+ 9
int main () {
srand(time(0));
for (int x = 1; x <= 6; x++) {
cout << 1+(rand()%6) << endl;
// return 0; // **not here **
}
return 0; // **here **
}
OR if only one number is required as output, you will not require a for loop. so the code would go something like.
int main () {
srand(time(0));
cout << 1+(rand()%6) << endl;
return 0;
}
+ 7
Move the return 0; statement down below the ending of the loop then well done.
return 0 ends the program. In its current placement it makes the for() loop useless.
+ 7
Check your email, there should be an email from them.
+ 7
+ 2
thank you very much @jay😄🤘😍
+ 2
tq bro@jay...
I just activated by changing email address to another one...tq😄
+ 1
I didn't get tht point,I'm just beginner @jay
0
bro @jay I can't up vote or down vote ur answer,it says pls verify ur email..so how can I do that?