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
netineya [11]
3 years ago
11

What is difference between rand() and srand() ?

Computers and Technology
1 answer:
gladu [14]3 years ago
5 0

Answer:

rand() function generate the random number within the range.

srand() function decide the starting point for random function or set the seed for rand() function.

Explanation:

rand() function which is used to generate the random number within the range.

srand() function is used to decide the starting point for random function.

In sort meaning, it set the seed for rand() function.

if srand() function not used, the random function generate the same output again and again because the starting point is fixed for generating the random number.

if srand() function used it change the starting point every time and random function generate the output different in every time.

You might be interested in
Which of these is a discipline?
ivolga24 [154]

Answer: Information technology

Nanotechnology

Explanation:

Database Managers are the individuals who responsible create databases for organizations and maintain existing ones.

Nanotechnology simply refers to a research field that has to do with the building of things and devices.

Information technology refers to the study of computers for the storage and sending of information.

A network technician is someone who maintains, and repairs computer systems and they also set up several Internet connections, and networks.

We should note that information technology and nanotechnology are both disciplines as they are studied in different colleges.

3 0
3 years ago
What is ambient sound, and what is its purpose in film? When can it be a drawback ?
Helen [10]

Answer:

Ambient sound is an environmental sound or surrounding sounds. They use this kind of sound to give a film's scene credence(belief in or acceptance of something as true). When the sound starts to become distracting to the audience the drawback is used.

Explanation:

6 0
3 years ago
Where in the windows registry would you store a key that starts an executable when the operating system starts?
Evgesh-ka [11]
Answer: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
4 0
3 years ago
Write a program that reads two fractions such as 1/2 and 1/4 and computes and stores the sum, the difference, the product and th
Vesnalui [34]

Answer:

1: #include <iostream>

2: using namespace std;

3: int main()

4: {

5: int a,b,c,d;

6: cout<<"n1: ";

7: cin>>a;

8: cout<<"d1: ";

9: cin>>b;

10: cout<<"n2: ";

11: cin>>c;

12: cout<<"d2: ";

13: cin>>d;

14: int top = (a*d)+(b*c);

15: int bottom = b*d;

16: cout<<"Sum: "<<top<<"/"<<bottom<<"\n";

17: top = (a*d)-(b*c);

18: cout<<"Difference: "<<top<<"/"<<bottom<<"\n";

19: top = a*c;

20: cout<<"Product: "<<top<<"/"<<bottom<<"\n";

21: top = a*d;

22: bottom = b*c;

23: cout<<"Quotient: "<<top<<"/"<<bottom<<"\n";

24: return 0;

25: }

Explanation:

The Program is written in C++ programming language

The Program is left numbered

Line 5 was used for variable declaration.

Variables a,b represents the numerator and denominator of the first fraction

While variables c,d represent the numerator and denominator of the second fraction

Line 6 prints "n1" without the quotes which represents the numerator of the first fraction

Line 7 accepts input for the numerator of the first fraction.

Line 8 prints "d1" without the quotes which represents the denominator of the first fraction

Line 9 accepts input for the denominator of the first fraction.

Line 10 prints "n2" without the quotes which represents the numerator of the second fraction

Line 11 accepts input for the numerator of the second fraction.

Line 12 prints "d2" without the quotes which represents the denominator of the second fraction

Line 13 accepts input for the denominator of the second fraction.

Line 14 and 15 calculate the sum of the fractions which is then printed on line 16

Line 17 calculates the difference of the fractions which is then printed on line 18

Line 19 calculates the product of the fractions which is then printed on line 20

Line 21 and 22 calculates the quotient of the fractions which is then printed on line 23

5 0
3 years ago
How do I go to files in Brainly I need help
Lyrx [107]

Answer:

There should be a little icon at the bottom of your question box/answer box. It looks like a paper clip. click it and boom

Explanation:

4 0
3 years ago
Other questions:
  • 1 what elements of composition are under your control in photoshop
    13·1 answer
  • Use induction on n to prove that fir all n&gt;=2, 2^n+3^n&lt;5^n
    11·1 answer
  • What could cause a fixed disk error.
    15·1 answer
  • Considering current online newspaper editions and the characteristics of digital age media, how do you think newspaper design mi
    7·1 answer
  • During which phase of film making does the team outline their vision for the film?
    5·1 answer
  • URGENT!!! Oliver is creating an image of a fruit basket. From the basket, he wants the red apples to stand out among the rest so
    14·2 answers
  • 1. Haruto was a programmer working in the early 2000s. Which kind of program or language was
    5·1 answer
  • Why wouldn't a game using just run-length encodings be challenging?
    9·1 answer
  • Write a script that checks to see if at least one argument has been given on the command line and tests whether the argument is
    5·1 answer
  • Write a program that defines an array of integers and a pointer to an integer. Make the pointer point to the beginning of the ar
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!