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]
2 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]2 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
30 POINTS Conduct Interviews
Kitty [74]

Answer:

still need help with this if so lmk so o can help ya asap:)9

5 0
3 years ago
What is the full form of ALU​
Alexandra [31]

Answer: arithmetic logic unit: the part of a central processing unit that performs arithmetic and logical operations.

Srry if it is wrong

I hope it  helps you

6 0
2 years ago
Read 2 more answers
A _____ chart provides a simple way to show trends and variations in a range of data within a single cell
ludmilkaskok [199]
Most reasonable answer is a line chart.
 
With line charts you can spot trends and variations in a certain range of data through different times or just different values of the variable that we plot on the x-axis. In general, line charts are often used in research that wants to depict time trends or how a certain variable progresses through different levels of the variable on the x-axis.
8 0
3 years ago
_____ formatting is the process of changing the way letters, numbers, punctuation marks, and symbols appear on the screen and in
MAXImum [283]
The answer would be character. " Character formatting is the process of changing the way letters, numbers, punctuation marks, and symbols appear on the screen and in print." Hope this helps!!
8 0
3 years ago
Which of the following calculates to 19<br>(3*6)+2/2<br>3*(6+2)/2<br>(3*6+2)/2<br>3*(6+2/2)​
Firdavs [7]

Answer: The first one (3*6)+2/2 will equal 19.

Explanation: If you use the order of operation you would do 3*6 first then add that to 2/2. So it would be 18+1=19.

3 0
2 years ago
Other questions:
  • What type of windows network model allows all the participants to be represented equally on the network with no single computer
    13·1 answer
  • Write the pseudocode for linear search, which scans through the sequence, looking for ν. Using a loop invariant, prove that your
    14·1 answer
  • Which algorithm makes the most efficient use ofmemory?
    9·1 answer
  • If you “bury” a story on Digg, what have you done
    10·1 answer
  • If Word finds a potential error in a document, a red, green, or blue wavy underline flags the problem.
    14·1 answer
  • Resumen sobre Tailandia​
    10·1 answer
  • The amount of data that can be stored on a disk depends in part on_____.
    13·1 answer
  • In Subtractive empathy, the counselor responses gives back less (or distorts) than what the client has said. slightly add someth
    14·1 answer
  • Which of the following statements should be avoided when developing a mission statement?
    13·1 answer
  • Lab 8-1: Working with Boot Loader and Runlevels what is the root password
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!