• Courses
  • Code Compiler
  • Discuss
  • Pricing
  • Teams
Menu
+ 1

what is srand()?pls explain it and it's functionality.

int main () { srand(98); for (int x = 1; x <= 10; x++) { cout << 1 + (rand() % 6) << endl; } } pls also explain this program's functionality

c++srand
25th Sep 2017, 2:48 PM
Shivani Goyal
2 Answers
+ 11
https://www.sololearn.com/discuss/600360/?ref=app https://www.sololearn.com/discuss/571632/?ref=app https://www.sololearn.com/discuss/247809/?ref=app https://www.sololearn.com/discuss/600365/?ref=app https://www.sololearn.com/discuss/591472/?ref=app
25th Sep 2017, 3:32 PM
Hatsy Rei
Hatsy Rei - avatar

Often have questions like this?

Learn more efficiently, for free:

  • Introduction to Python

    7.1M learners

  • Introduction to Java

    4.7M learners

  • Introduction to C

    1.5M learners

  • Introduction to HTML

    7.5M learners

See all courses
Hot today
Hello World!
0 Votes
What is wrost mistake that mostly people made while learning coding?
0 Votes
I'm lost with JavaScript (document.getElementById(".") And clearly making mistakes, Can someone help, I thought I had it but no.
0 Votes
What’s the actual difference between MB and GB in real-world usage?
1 Votes
Script file names
0 Votes
How to put multiple inputs in python?
1 Votes
Html learn
1 Votes
Je cherche des gens qui parle français pour apprendre le langage c
0 Votes
What can I do after learning python and how to create amazing codes. And how many times it would take to be a good programmer😅
0 Votes
Python ???
0 Votes