Give me compliments about my first program. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 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

19th Jan 2018, 9:56 AM
manoj manu
8 Answers
+ 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; }
19th Jan 2018, 10:09 AM
jay
jay - avatar
+ 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.
19th Jan 2018, 9:59 AM
jay
jay - avatar
+ 7
Check your email, there should be an email from them.
19th Jan 2018, 10:20 AM
jay
jay - avatar
19th Jan 2018, 10:21 AM
jay
jay - avatar
+ 2
thank you very much @jay😄🤘😍
19th Jan 2018, 10:12 AM
manoj manu
+ 2
tq bro@jay... I just activated by changing email address to another one...tq😄
19th Jan 2018, 10:24 AM
manoj manu
+ 1
I didn't get tht point,I'm just beginner @jay
19th Jan 2018, 10:07 AM
manoj manu
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?
19th Jan 2018, 10:17 AM
manoj manu