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, 23.06.2019 09:30
Given a link with a maximum transmission rate of 32.8 mbps. only two computers, x and y, wish to transmit starting at time t = 0 seconds. computer x sends filex (4 mib) and computer y sends filey (244 kib), both starting at time t = 0. statistical multiplexing is used, with details as follows packet payload size = 1000 bytes packet header size = 24 bytes (overhead) ignore processing and queueing delays assume partial packets (packets consisting of less than 1000 bytes of data) are padded so that they are the same size as full packets. assume continuous alternating-packet transmission. computer x gets the transmission medium first. at what time (t = ? ) would filey finish transmitting? give answer in milliseconds, without units, and round to one decimal places (e.g. for an answer of 0.013777 seconds you would enter "13.8" without the quotes)
Answers: 3
question
Computers and Technology, 23.06.2019 10:20
Suppose there is a relation r(a, b, c) with a b+-tree index with search keys (a, b).1. what is the worst-case cost of finding records satisfying 10 < a < 50 using this index, in terms of the number of records n1, retrieved and the height h of the tree? 2. what is the worst-case cost of finding records satisfying 10 < a < 50 and 5 < b < 10 using this index, in terms of the number of records n2 that satisfy this selection, as well as n1 and h defined above? 3. under what conditions on n1 and n2, would the index be an efficient way of finding records satisfying the condition from part (2)?
Answers: 1
question
Computers and Technology, 23.06.2019 17:00
What are the 12 colors of the spectrum called?
Answers: 1
question
Computers and Technology, 23.06.2019 19:30
2. fluorine and chlorine molecules are blamed fora trapping the sun's energyob forming acid rainoc producing smogod destroying ozone molecules
Answers: 2
You know the right answer?
You can generate a random number in c using the following code: int myrandomnumber; srand(time(nul...
Questions
question
Mathematics, 07.09.2020 02:01
question
Mathematics, 07.09.2020 02:01
Questions on the website: 13722363