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
Romashka [77]
3 years ago
8

Type two statements that use rand() to print 2 random integers between (and including) 100 and 149. End with a newline. Ex:

Computers and Technology
2 answers:
Dahasolnce [82]3 years ago
8 0

Answer:

#include

#include // Enables use of rand()

#include // Enables use of time()

int main(void) {

int seedVal = 0;

seedVal = 4;

srand(seedVal);

cout<< rand()%(int)(149-100+1) + 100;

cout<< rand()%(int)(149-100+1) + 100;

return 0;

}

Explanation:

The code segment starts at line 8 and ends at line 9.

That is:

cout<< rand()%(int)(149-100+1) + 100;

cout<< rand()%(int)(149-100+1) + 100;

The syntax for generating random values in C using rand function is

rand()%(int)(max - min + 1) + min

Or

min + rand()%(int)(max - min + 1).

It works both ways..

Where max and min represent the range of values needed (maximum and minimum)

The random statement can also be used in loops

rosijanka [135]3 years ago
6 0

Answer:

#include <stdlib.h>

#include <time.h>

#include<iostream.h>

int main(void) {

   int seedVal = 0;  

   seedVal = 4;

   srand(seedVal);

  /* Solution*/

  cout<<rand() % 149 + 100<<endl;

  cout<<rand() % 149 + 100<<endl;

  return 0;

}

Explanation:

We start with the required include statements to enable use of srand, rand and time functions. I have also added iostream library to use "cout" function.

After that, the seed is initialized using srand(). And then the two rand functions are called with ranges including and between 100 and 149, and printed out.

You might be interested in
What is one benefit of Powerpoint Online?
VashaNatasha [74]

Answer:

for edge users

anyone with the url

Explanation:

6 0
3 years ago
Read 2 more answers
Match the keyword to its definition. 1 . Pixel A device that is not central to the operations of a computer 2 . Peripheral Stand
photoshop1234 [79]

Answer:

1 . Pixel:  Smallest element of a picture on a computer display.

2 . Peripheral: A device that is not central to the operations of a computer.

3 . Small computer system interface: Interface for computer device that has its own control function

4 . Input: Devices that take information from the computer user and deliver it to the processor

5 . electrostatic discharge: The instantaneous flow of electricity between two objects when they touch

6 . storage: Devices like hard drives or floppy disks that store data .

7 . Integrated drive electronics: Standard that addresses the physical connection and transfer speed between a computer and a peripheral device

8 . Bluetooth: A wireless technology that uses radio waves to transmit data across short distances.

9 . Output: Devices that take information from the processor and deliver it to the computer user

10 . Megabits per second: Measurement of the speed of data transfer

4 0
3 years ago
Its an HTML5 anyone kwons
Aleksandr [31]

Answer:

1 will be stored in result

Explanation:

Given

The lines of code

Required

Determine the value stored in result

The value stored in result is determine by the condition (x<3 && y ==6)

In the first line, the value of x is 2 and the value of y is 6

So: x<3 is true because x = 2 and 2 is less than 3

y == 6 is also true because y = 6 and 6 is equal to 6

So, the condition (x<3 && y ==6) is true and true will be saved in variable result

Because result is a Boolean variable which can only take true or false value

1 represents true

0 represents false

<em>So, 1 will be stored in result</em>

7 0
3 years ago
Which risk management framework does the organization of standardization publish
olga2289 [7]

Answer:

ISO 31000:2009 publishes principles and generic guidelines on risk management.

Explanation:

ISO 31000:2009 can be applied to any public, private or community company, organization, society or individual. Hence, ISO 31000:2009 is not particular to either business or area.

ISO 31000:2009 can be implemented during the period of an industry and to a broad variety of actions, including policies and judgments, guidance, methods, functions, plans, goods, services, and assets.

ISO 31000:2009 can be implemented to any type of danger, whatever its kind, whether possessing positive or negative outgrowths.

3 0
4 years ago
Linda works from home occasionally and needs to set up her computer at work so she can remote in from her home office. Which too
qwelly [4]

Explanation:

Check the type of hard drive installed.

hope this helps you ❣️

4 0
3 years ago
Other questions:
  • In a word processing program, the ribbon or menus contain the
    12·1 answer
  • What is an extrinsic value? A. something that is valuable in and of itself B. something that is valuable because it leads to ano
    12·1 answer
  • Bullet points on a slide should be limited to _____. 2 4 8 10
    15·2 answers
  • A raised dot (ú) shows where the enter key was pressed. true or false.
    13·1 answer
  • Write a program that calculates taxi fare at a rate of $1.50 per mile. Your pro-gram should interact with the user in this manne
    12·1 answer
  • Which quality allows programmers to modify a program as and when required
    11·2 answers
  • Write an algorithm using pseudocode to input numbers . reject any numbers that are negative and count how many numbers are posit
    10·1 answer
  • Difference between primary key and foreign key
    12·1 answer
  • Dispositivo de computo
    5·1 answer
  • Chloe is creating the software requirements specifications (SRS) for a project. The project is a web app that allows students to
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!