I know there are a lot of topcs.
I was searching for what i needed.But as i sow there wasn't anything that i can specifically use.
I need a short code that generates 10 random numbers.
Anyone help?

Jackk123
Recommended Answers
Jump to PostThat's nothing a quick google can't help you with. But since you asked here it is :
#include <iostream> #include <ctime> using namespace std; int main(){ srand(time(0)); for(int i = 0; i != 10; ++i){ cout << rand() << endl; } }
Jump to Postdo you need just the function to generate the random numbers or would you like to
know how a rand() like function is working?
Jump to PostHey Jackk, I don't know if you been drinking Jack or something, but you need to watch
your manners. This isn't your house, so you don't get to shout or demand.
All 10 Replies
mrnutty 761 Senior Poster
NicAx64 76 Posting Pro

Jackk123
astala27 0 Newbie Poster

Jackk123
NicAx64 76 Posting Pro
Nathaniel10 34 Junior Poster

Jackk123

Jackk123
mrnutty 761 Senior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.