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

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 21:20
Your program will make use of long long int variables for all calculations. note: the use of long long int requires that you have c++11 support. you should have this automatically if you are using a newer version of visual studio. the support is there for gcc as well, but you may need the -std=c++11 or -std=c++0x compiler flag. you first need to read in the total number of seconds. there is no prompt for the read (that is, you just do the cin without using a cout to display a prompt). this is going to seem a little strange when you are running your program in your ide
Answers: 2
question
Computers and Technology, 24.06.2019 18:30
How does the use of e-mail benefit business communications? it can be sent at any time. it is faster than regular mail. it improves writing skills. it is less expensive than using a courier. it reduces the need for proofreading.
Answers: 1
question
Computers and Technology, 25.06.2019 05:30
The police department is excited to have some new motorcycle units. one officer said that these motorcycles can go from 0 miles per hour to 80 miles per hour in just 6 seconds. the officer is describing the motorcycle's a. average speed. b. distance. c. average velocity. d. acceleration.
Answers: 1
question
Computers and Technology, 25.06.2019 06:30
If she presses the left arrow , what will happened
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
question
English, 14.02.2021 16:30
question
Engineering, 14.02.2021 16:30
question
Computers and Technology, 14.02.2021 16:30
Questions on the website: 13722361