~I need to do the following

~ Take Input from number assign it to variable maxNumber
~ Create variable called randomN and assign a random number from 0-maxNumber to randomN

-C++

Please need help thank you.

Use the modular operator, which will return a value between 0 and maxNumber. int x = rand() % maxNumber;

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.