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
Over [174]
3 years ago
5

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)

Engineering
1 answer:
liq [111]3 years ago
4 0

Answer:

View Image

Explanation:

No number is really ever random. It all has a seed, which is an initial value for the 'random' number to be generated. The rand() function uses an equation to  generate its value, and all its 'random' value depend on the first number you plug in into your equation. The initial number you plug into your equation is what srand() do.

If you just call rand() alone without calling srand() then the generated numbers will automatically use srand(1) as a default seed. Using the same srand() value will always yield the same sequence of numbers.

To get a number between 0 and 9, take the modulus of it with 10 because modulus give you the remainder, so the number rand()%10 will never be equal to 10 or greater.

You might be interested in
X²-12x=0 ПЖ срочно реально решите помагие ​
nika2105 [10]

Answer:

формула pq sry i dont speak russian lol but thats the solution of the equation

4 0
3 years ago
An aluminum alloy tube with an outside diameter of 3.50 in. and a wall thickness of 0.30 in. is used as a 14 ft long column. Ass
slega [8]

Answer:

slenderness ratio = 147.8

buckling load = 13.62 kips

Explanation:

Given data:

outside diameter is 3.50 inc

wall thickness 0.30 inc

length of column is 14 ft

E = 10,000 ksi

moment of inertia = \frac{\pi}{64 (D_O^2 -D_i^2)}

I = \frac{\pi}{64}(3.5^2 -2.9^2) = 3.894 in^4

Area = \frac{\pi}{4} (3.5^2 -2.9^2) = 3.015 in^2

radius = \sqrt{\frac{I}{A}}

r = \sqrt{\frac{3.894}{3.015}

r = 1.136 in

slenderness ratio = \frac{L}{r}

                              = \frac{14 *12}{1.136} = 147.8

buckling load = P_cr = \frac{\pi^2 EI}}{l^2}

P_{cr} = \frac{\pi^2 *10,000*3.844}{( 14\times 12)^2}

P_{cr} = 13.62 kips

3 0
3 years ago
If the slotted arm rotates counterclockwise with a constant angular velocity of thetadot = 2rad/s, determine the magnitudes of t
astraxan [27]

Answer:

Magnitude of velocity=10.67 m/s

Magnitude of acceleration=24.62 ft/s^{2}

Explanation:

The solution of the problem is given in the attachments

3 0
3 years ago
Is 4/16 equal in measurement to 1/4
Alja [10]

Answer:yes

Explanation:

5 0
3 years ago
Read 2 more answers
I wish to have a computer whose machine-level instructions are all 32 bits each. If I want to have all instructions of the form
melisa1 [442]

Answer:

Maximum number that can be represented by 13 bits  is 8192 Instructions

Explanation:

number of instructions = 1000

number of bits = log(1000) x number of register

                          = 6 bits

Since the complete instruction must have 32 bits, then

remaining number of bits = 32 - 6 = 236

number of registers in instruction = 2

number of bits per register = 26/2 = 13

Maximum number that can be represented by 13 bits = 2^{n}

                       = 2¹³ = 8192

4 0
3 years ago
Other questions:
  • While discussing what affects the amount of pressure exerted by the brakes: Technician A says that the shorter the line, the mor
    14·1 answer
  • Paint can shaker mechanisms are common in paint and hardware stores. While they do a good job of mixing the paint, they are also
    15·1 answer
  • After a 65 newton weight has fallen freely from rest a vertical distance of 5.3 meters, the kinetic energy of the weight is
    12·1 answer
  • Chemical manufacturers must present which information on the product's label?
    5·1 answer
  • Which of the following is correct oil viscosity for hybrid electric vehicle?
    10·1 answer
  • How do you make a robotic dog
    6·2 answers
  • Cast iron has about how much carbon content?
    12·1 answer
  • A tiger cub has a pattern of stripes on it for that is similar to that of his parents where are the instructions stored that pro
    8·1 answer
  • What is the sun's degree angle in the sky in summer and in winter?
    8·1 answer
  • For installations where the nonlinear load is huge, most consulting engineers will specify ____-rated transformers.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!