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
an oven takes 15A at 240V,it required to reduce current to 12V find resistance which must be connected in series​
avanturin [10]

Answer:

Explanation:0

8 0
3 years ago
Durante el segundo trimestre de 2001, Tiger Woods fue el golfista que más dinero ganó en el PGATour. Sus ganancias sumaron un to
ehidna [41]

Answer: a. 0.4667

b. 0.4667 and C 0.0667

Explanation:

Given Data:

N = population size (10)

n = random selection (2)

r = number of observations = 7

Therefore

f(y) = ( r/y ) ( N - r / n - y ) / ( N /n )

When y = 1

f(1) = ( 7/1 ) ( 10 - 7 / 2 -1 ) / ( 10/2 )

= 7 / 15

= 0.4667

When y = 2

f(2) = ( 7/2 ) ( 10 - 7 / 2 -2 ) / ( 10/2 )

= 7 / 15

= 0.4667

When y = 0

f(0) = ( 7/0 ) ( 10 - 7 / 2 -0) / ( 10/2 )

= 1 / 15

= 0.0667

8 0
3 years ago
Ignoring any losses, estimate how much energy (in units of Btu) is required to raise the temperature of water in a 90-gallon hot
Rudik [331]

Answer:

Q=36444.11 Btu

Explanation:

Given that

Initial temperature = 60° F

Final temperature = 110° F

Specific heat of water = 0.999 Btu/lbm.R

Volume of water = 90 gallon

Mass = Volume x density

1\ gallon = 0.13ft^3

Mass ,m= 90 x 0.13 x 62.36 lbm

m=729.62 lbm

We know that sensible heat given as

Q= m Cp ΔT

Now by putting the values

Q= 729.62 x 0.999 x (110-60) Btu

Q=36444.11 Btu

5 0
3 years ago
Given a matrix, clockwise-rotate elements in it. Please add code to problem3.cpp and the makefile. Use the code in p3 to test yo
rusak2 [61]

Answer:

/* C Program to rotate matrix by 90 degrees */

#include<stdio.h>

int main()

{

int matrix[100][100];

int m,n,i,j;

printf("Enter row and columns of matrix: ");

scanf("%d%d",&m,&n);

 

/* Enter m*n array elements */

printf("Enter matrix elements: \n");

for(i=0;i<m;i++)

{

 for(j=0;j<n;j++)

 {

  scanf("%d",&matrix[i][j]);

 }

}

 

/* matrix after the 90 degrees rotation */

printf("Matrix after 90 degrees roration \n");

for(i=0;i<n;i++)

{

 for(j=m-1;j>=0;j--)

 {

  printf("%d  ",matrix[j][i]);

 }

 printf("\n");

}

 

return 0;

 

}

5 0
3 years ago
Information or signals entered into a computer system is
Virty [35]

<em>Logs.</em>

<em>Like data logs. Sometimes people make these logs to keep tabs on other people or to get important information put down somewhere that way it is saved and can be looked back upon later. Anytime someone makes an action on the computer, it makes a TMP file representing a log of what you want it to do before the computer quickly get's rid of the file.</em>

<em>-Ɽ3₮Ɽ0 Ⱬ3Ɽ0</em>

<em />

8 0
2 years ago
Other questions:
  • What are the three main areas of bioengineering?
    11·1 answer
  • A satellite orbits the Earth every 2 hours at an average distance from the Earth's centre of 8000km. (i) What is the average ang
    7·1 answer
  • A small wind tunnel in a university’s undergraduate fluid flow laboratory has a test section that is 20 in. by 20 in. in cross s
    8·1 answer
  • "A fluid at a pressure of 7 atm with a specific volume of 0.11 m3/kg is constrained in a cylinder behind a piston. It is allowed
    6·1 answer
  • 1 kg of oxygen is heated from 20 to 120°C. Determine the amount of heat transfer required when this is done during a (a) constan
    7·1 answer
  • Is a unit of measurement for angles
    15·1 answer
  • 1. advantages of 2 pulley system
    13·1 answer
  • Most goals
    12·1 answer
  • Engine horsepower decreases ________% for every___________feet above sea level.
    9·1 answer
  • 8th grade safety test
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!