1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
zlopas [31]
3 years ago
12

Type a statement using srand() to seed random number generation using variable seedVal. Then type two statements using rand() to

print two random integers between (and including) 0 and 9. End with a newline. Ex:
5.
7.
Note: For this activity, using one statement may yield different output (due to the compiler calling rand() in a different order). Use two statements for this activity. Also, after calling srand() once, do not call srand() again. (Notes)
1 #include
2 #include //
3 Enables use of rand ()
4 int main(void) ( int seedval;
6.
7. scanf ("%d", &seedval);
8.
9.
10 srand(int seedval);
11 printf("%d\n", srand());
12 printf("%d\n", srand());
13
14 return e;
15 }
Computers and Technology
1 answer:
Alik [6]3 years ago
8 0

Answer:

#include<stdio.h>

#include<stdlib.h>

int main(void){

int seedval;

scanf ("%d", &seedval);

srand(seedval);

printf("%d\n", rand()%10);

printf("%d\n", rand()%10);

 return 0;

}

Explanation:

The given code is poorly formatted. So, I picked what is usable from the code to write the following lines of code:

#include<stdio.h>

#include<stdlib.h>

int main(void){

This line declares seedval as integer

int seedval;

This line gets user input for seedval

scanf ("%d", &seedval);

This line calls the srand function to generate random numbers

srand(seedval);

This prints a random number between 0 and 9

printf("%d\n", rand()%10);

This also prints a random number between 0 and 9

printf("%d\n", rand()%10);

 return 0;

}

You might be interested in
How to select the entire worksheet?
Archy [21]
Hey there! Hello! 

In an instance of Microsoft Excel 2016, you can select your entire worksheet by using the Ctrl-A shortcut on your keyboard for Windows, or Command-A in the case of a Mac. If you have a standard Windows keyboard, you should have two Ctrl keys on either side of your keyboard. On a standard Mac keyboard, you'll also find that there are two Command keys on either side of your space key. This shortcut applies to other things as well, such as documents in Word. It basically selects everything there is to select. 

I have attached a screenshot of the result of doing Command-A on a blank document. Everything within the bolded green outline is selected – it's typical for the cell you were on to be white instead of your highlight color (which is grey, in my case), and it will be selected, too. 

Hope this helped you out! Feel free to ask me any additional questions if you have any. :-)

7 0
3 years ago
Which passage form the passage best contributes to elisa impatient tone
dusya [7]
You need to attach a document of where i would read it from
4 0
3 years ago
Jacob is preparing a presentation on the health and social advantages of taking up a sport at an early age. Most of the slides i
NARA [144]

Answer:

It's C

Explanation:

On edgenuity

4 0
3 years ago
A business that subscribes to a specific computing model has its entire system fully functional within a short time. What benefi
ASHA 777 [7]

Answer

economies of scale

Explanation

Cloud computing  is the practice of using a network of remote servers hosted on the Internet to store, manage, and process data, rather than a local server or a personal computer.  Benefits of moving everyday business to the cloud is that it can provide small businesses with significant savings. In cloud computing Virtualization increases the value of physical server hardware, meaning businesses can do more with less.Business that subscribes to a specific computing model has its entire system fully functional within a short time  will have economies of scale benefit. This is because this will be consuming information technology that can lead to significant cost saving.


6 0
3 years ago
Read 2 more answers
What is the appropriate guidelines to create and manage files
Maurinko [17]

Answer:

1. Do not copyright

2. Nothing illegal

3.Do not put personal info

Explanation:

3 0
3 years ago
Other questions:
  • Jason works as a financial investment advisor. He collects financial data from clients, processes the data online to calculate t
    9·1 answer
  • A computer is defined by 4 specific criteri. Select all 4.*
    7·1 answer
  • This is a wise and hard question.....What is the hardest question in the world? I know the answer do you?
    10·1 answer
  • What are 2 plants that grow best in our soil type ​
    9·1 answer
  • The box formed by the intersection of a row and column in a spreadsheet program is known as a ________.
    13·1 answer
  • What is done when Python complies your program
    9·2 answers
  • A technician has a client’s laptop that is randomly shutting down. Which of the following is the FIRST step of the troubleshooti
    10·1 answer
  • Please help I will mark brainliest
    11·2 answers
  • What is an advantage of using a dynamic hard drive in a vm?
    10·1 answer
  • In the context of machine learning, an artificial neural network (ann) is most likely used for?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!