1
answer
0
watching
80
views

int myRandomNumber;

srand(time(NULL)); // seed the random number generator

myRandomNumber = rand(); // each time you call this function there will be a different random number.

Generate a random number, and output it. Use if statements to determine if the number is odd or even, and output a message to that effect. Similarly, output if the number is divisible by 3, and if it is divisible by 10. Use the % operator to achieve this. Run the program, and print the results several times using different numbers to be sure that it’s working.

For unlimited access to Homework Help, a Homework+ subscription is required.

Karol A.
Karol A.Lv10
8 Mar 2021

Unlock all answers

Get 1 free homework help answer.
Already have an account? Log in

Weekly leaderboard

Start filling in the gaps now
Log in