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, 22.06.2019 22:30
Jason needs to learn a new web tool. he went through his books to understand more about it. now he wants hands-on experience with using that tool. what would him? jason can use websites where workspace is provided to test the results of your code.
Answers: 2
question
Computers and Technology, 24.06.2019 08:30
Intellectual property rights are exclusive rights that protect both the created and the creation. ipr offers exclusively what benefits to the person or people covered by it
Answers: 3
question
Computers and Technology, 24.06.2019 12:50
Write a new lc-3 trap subroutine (i.e. a subroutine that will be invoked via the trap instruction) that will receive a numeric digit entered at the keyboard (i.e. an ascii character), echo it to the screen, and return in r0 the corresponding numeric value: so if the user types the digit '7', the character '7' will appear on the screen, but the value returned in r0 will be b0000 0000 0000 0111 (#7) you may not use any trap calls in your code - you must implement the "polling" code that interrogates the keyboard status and data registers. ; getnum_tsr ; a subroutine for obtaining a numeric value ; given ascii numeric digit input to keyboard. ; the numeric digit is echoed to the console (e.g. '7' = b0000 0000 0011 0111), ; but the value returned in r0 is the actual numeric value ; corresponding to the digit (e.g. b0000 0000 0000 0111 =
Answers: 3
question
Computers and Technology, 24.06.2019 20:20
Write python code that prompts the user to enter his or her favorite color and assigns the user’s input to a variable named color.
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
Arts, 23.12.2020 01:00
question
Biology, 23.12.2020 01:00
question
Mathematics, 23.12.2020 01:00
question
History, 23.12.2020 01:00
question
Mathematics, 23.12.2020 01:10
Questions on the website: 13722363