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
_____ are different, even within the same job. a. Occupations b. Workplaces c. Careers d. Interest rates
pickupchik [31]
Hello,

Here is your answer:

The proper answer to this question is option B or "workplaces". Workplaces are where the person stays to do his or her job although they have the same job WORKPLACES are different.

Your answer is B.

If you need anymore help feel free to ask me!

Hope this helps!
3 0
4 years ago
Read 2 more answers
Which describes the first step a crawler-based search engine uses to find information?
elena-14-01-66 [18.8K]
C is the correct answer to the problem
6 0
3 years ago
Read 2 more answers
On which tab is the function library group located in excel
Neko [114]

The function library group is located in the "formulas" tab

7 0
4 years ago
Read 2 more answers
As u type where does excel display the entry
grigory [225]

Answer:

The Active cell inside Excel Worksheet is used to identify the cell which is currently active. The thick border gridlines around the cell indicates that it is the Active cell inside Excel Worksheet. The Active cell is where the focus is on and where the data will be entered when a key is typed on keyboard.

5 0
3 years ago
If there are three classes, Shape, Circle and Square, what is the most likely relationship among them?
xz_007 [3.2K]

Answer: B) Shape is a base class, and circle and square are derived classes of Shape.

Explanation:

Shape is a base class because circle and squares are the shapes so these are the derived class of the shape, which is inherited by the shape like circle and square. As, the base class (shape) is the class which are derived from the other classes like circle and square and it facilitates other class which can simplified the code re-usability that is inherited from the base class. Base class is also known as parent class and the super class.  

8 0
4 years ago
Other questions:
  • The information gathering technique that enables the analyst to collect facts and opinions from a wide range of geographically d
    11·1 answer
  • Which of the following are types of home internet service? Check all that apply
    7·1 answer
  • In cell F15, insert a function that will automatically display the word Discontinue if the value in cell D15 is less than 1500,
    6·1 answer
  • Which term is used to describe bitmap images
    8·2 answers
  • IN YOUR OWN WORDS, create a new thread and compare and contrast paraphrasing, summarizing, and quoting and how to do each succes
    14·1 answer
  • Which of the following best describes when a packet is addressed so that more than one destination can receive it and the first
    11·1 answer
  • Do you think<br> brain uploading<br> is a good idea?
    7·1 answer
  • Which type of relationship is responsible for teaching you values and how to communicate?
    9·1 answer
  • Advantages and disadvantages of a watch tower​
    15·1 answer
  • Assuming a 32bit processor If I have a double pointer defined as dPtr and I add 1 to it. How many bytes are added to the address
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!