Which of the following statements generates a random number between 0 and 50?

Choices;

a. srand(time(0));

num = rand() % 50;

b. srand(time(0));

num = rand()50;

c. srand(time(10));

num = rand() % 50;

d. srand(time(10));

num = rand()/50;

Answers

Answer 1

Srand(time(0)); num = rand() %50 is statements generates a random number between 0 and 50

What are the functions of time and Srand?A distinct sequence results from changing the seed value. The computer's internal clock is used by srand(time(NULL)); to regulate the seed selection. The seed is always changing since time is a moving target.Time(0) provides the amount of time in seconds since the Unix epoch, making it a decent "unpredictable" seed (you can be sure your seed will only be the same once, unless you run your application more than once in the same second).Because the rand() function always produces the same sequence of numbers, the results are not truly random.

To learn more about Srand refer to:

https://brainly.com/question/16792424

#SPJ1


Related Questions

Need an answer in Python

Write a program for. checking the truth of the statement ¬(X ⋁ Y ⋁ Z) = ¬X ⋀ ¬Y ⋀ ¬Z for all predicate values.

Answers

Using the knowledge in computational language in python it is possible to write a code that checking the truth of the statement ¬(X ⋁ Y ⋁ Z) = ¬X ⋀ ¬Y ⋀ ¬Z for all predicate values.

Writting the code:

def conjunction(p, q):

    return p and q

print("p    q    a")

for p in [True, False]:

    for q in [True, False]:

        a = conjunction(p, q)

        print(p, q, a)

def exclusive_disjunction(p, q):

    return (p and not q) or (not p and q)

print("p    q    a")

for p in [True, False]:

    for q in [True, False]:

        a = exclusive_disjunction(p, q)

        print(p, q, a)

See more about python at brainly.com/question/18502436

#SPJ1

Which of the following is NOT a valid SQL Comparison Operator in the WHERE clause? O a) <> b) != Oc c) NOT BETWEEN d) IS NOT NULL

Answers

B.)!

The exclamation point (!) has the same functionality as the NOT operator.

all of the following are popular linux distributions, except:_______.
A. Red Hat
B. Ubuntu
C. Debian
D. Deviant

Answers

The option that are popular Linux distributions, except option D. Deviant.

What does Linux distribution refer to?

A Linux distribution, also known as a "Linux distro," is a version of the free and open-source Linux operating system that includes additional software, such as the KVM hypervisor, as well as installation programs, management tools, and other software.

Therefore, There are commercially supported distributions like Fedora (Red Hat), openSUSE (SUSE), and Ubuntu (Canonical Ltd.), as well as distributions that are solely community-driven like Debian, Slackware, Gentoo, and Arch Linux.

Learn more about Linux distributions from

https://brainly.com/question/13139061
#SPJ1

What are the messages that show up in a successful compilation of QBasic Program?

Answers

Answer:

The END statement is used to terminate a program . It is used as the last statement of a program and it is an optional statement .

Explanation:

i think

what member of an organization should decide where the information security function belongs within the organizational structure? why?

Answers

Answer:

Chief Information Officer (CIO) should be responsible for the overall management of information and data within the organization, and as such, is in the best position to understand the risks and vulnerabilities associated with this information.

The CIO can ensure that the information security function is able to effectively protect the organization's information and data, while also supporting the organization's business objectives.

8
Among the structural semantic elements, which of these elements represents a section of content that is independent of a web page or site content?
a) section
b) article
c) header
d) aside

Answers

The elements represents a section of content that is independent of a web page or site  is article

What is meant by web page ?

A web page is a straightforward document that a browser can see. These publications are created using the HTML coding system (which we look into in more detail in other articles). A web page can incorporate many various sorts of resources, including style data, which governs the appearance and feel of the page.

A web page is a document that may be found online. A web browser can be used to view web pages that are stored on a web server. Huge amounts of text, graphics, audio, video, and hyperlinks can all be found on a single web page. To other web pages, use these hyperlinks.

To learn more about web page refer to:

https://brainly.com/question/28431103

#SPJ1

The elements represents a section of content that is independent of a web page or site  is article.

What is meant by web page ?A web page is a straightforward document that a browser can see. These publications are created using the HTML coding system (which we look into in more detail in other articles). A web page can incorporate many various sorts of resources, including style data, which governs the appearance and feel of the page.A web page is a document that may be found online. A web browser can be used to view web pages that are stored on a web server. Huge amounts of text, graphics, audio, video, and hyperlinks can all be found on a single web page. To other web pages, use these hyperlinks.

To learn more about Web page refer to:

https://brainly.com/question/28431103

#SPJ1

what represents a user’s specific preferences?

Answers

The factor that represents the user's specific preference is the profile. (Option B)

What is userspecific prefernece?

Configure user preferences to indicate parameters that may be adjusted for a specific user. Each user of the Cram program is given a set of DefaultPreferences. The web client has a user preferences editor. This editor allows each user to change the preferences values.

Cookies, which are saved in Web client browsers, are used to store customized preferences. As a result, if you approach the server using a browser other than the one for which you set up cookies, your preferences will be lost.

Learn more about User Specific Preferences:
https://brainly.com/question/24143212
#SPJ1

Full Question:

What represents a user's specific preferences?

Permissions

Profile

Algorithmic Personal Outline

User Preferences

Choose the parts of the browser window.
1. [ web form, keyword list, pliers, status bar ]
2. [ url repo, scissors tool, display window, mail bar ]
3. [ exclamation bar, address bar, menu button, lucky button ]
4. [ title bar, back button, forward bar, enter bar ]

Answers

Answer:

It's number 4.

Explanation:

In your browser you have a title bar, where you input the web address or search query. You have the Forward and Back button to navigate between the history of the current tab.

The other guy didn't even try sorry about that :/

My best guess is the following

1.

keyword list

2.

display window

3.

address bar

4.

back button

Other Questions
laser light ( = 568.7 nm) is incident on a single slit. what is the maximum width of the slit (in nm) for which no diffraction minima are observed? round to the closest integer. What are the 5 signs of dehydration?. How many larynx do we have in our body?. some proteins, such as enzymes and transport proteins, are soluble in water. others, like the fibrous proteins, are not soluble in water. Are all equilateral triangles also isosceles triangles are all isosceles triangles also equilateral triangles explain?. In your opinion, what is the difference between neutrality, indifference, and empathy? which one of these words best describes the position of the united states during the early years of world war 1?. What is the meaning of chronological pattern?. What is the general rules for serving food and beverage?. How do you properly hydrate?. in the osi model, an ip packet, often called a(n)____, has two main sections: the header and the data section (sometimes called the payload). In which parent could chromosomal rearrangement have made an x chromosome with 2 fur color alleles? mother father either mother or father. (b) Prove that the points (0, 0), (1, 0), (1, 1), and (0, 1) are the vertices of aunit square. Also plot the square on graph paper. What does the introduction in chapter 1 contain?. Which of the following statements regarding global segmentation, targeting, and positioning is true?A. Companies must continually adjust products and marketing strategies to meet the changing needs of global markets.B. Global segmentation, targeting, and positioning activities are far less complicated than the same activities in the domestic market.C. When developing a global STP strategy, it is best to define segments by geography alone.D. Segmentation, targeting, and positioning activities for global markets do not differ substantially from that of domestic markets.E. The "golden rule" for global STP activities for firms is to never alter a firm's marketing mix to serve the needs of global markets. harold has a high need for achievement. based on this information, you can most accurately predict that given an opportunity to throw ten free shots from anywhere on a basketball court, harold will stand . a bucket of water can be whirled in a veritcal circile without water spilling out, even at the top of the circle when the bucket is upside down. explain why this is case? Find the term named in the problem and the explicit formula.13) 18,14,10,6, 14) 30,0,-30,-60, Find aFind a15) -34,-31,-28,-25, Find a explain the concepts of linear regression, including what you are evaluating, when it should be used, and the differences between a dependent variable and independent variable. regular elections, broad suffrage, freedom of speech and the press, and freedom to join or form political organizations are significant because the socially efficient level of production occurs where the marginal cost curve intersects question 46 options: a) marginal revenue. b) average total cost. c) demand. d) average variable cost.