subject

You can generate a random number in c using the following code: 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. hint: in c you can not declare variables after you write executable code. for example if you call the srand function, and then declare some more variables after that call, the program will not compile. the compiler messages are not very . put all the variable declarations at the top of the function.

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 09:00, sabahfayaskhan
Which best describes the condition under which the unicode output is the same as plain text?
Answers: 3
image
Computers and Technology, 22.06.2019 17:30, kameronstebbins
Which tab should you open to find the option for adding a header?
Answers: 1
image
Computers and Technology, 22.06.2019 18:30, lizz1228
Kto rozmawia z clamentain przez krótkofalówke w the walking dead w 4 epizodzie
Answers: 1
image
Computers and Technology, 22.06.2019 18:30, yayamcneal05
Which cultural aspect does this type of song best portray? a german polka dance
Answers: 1
You know the right answer?
You can generate a random number in c using the following code: int myrandomnumber; srand(time(nul...

Questions in other subjects:

Konu
Mathematics, 19.01.2021 23:10
Konu
Chemistry, 19.01.2021 23:10