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
Harman [31]
3 years ago
7

Write a c++ program that generates three random numbers. The first number should be between 0-30, the second number should be be

tween 30-60 and the third number should be between 60-90.
Computers and Technology
1 answer:
Rama09 [41]3 years ago
8 0

Answer:

#include <stdlib.h>

#include <time.h>  

#include <iostream>

using namespace std;

int main() {

   srand(time(NULL));

   cout << rand() % 30 << endl;

   cout << rand() % 30 + 30 << endl;

   cout << rand() % 30 + 60 << endl;

}

Explanation:

rand() returns a pseudo-random integral number in the range between 0 and RAND_MAX. By applying the modulo operator, you map that to the desired range (30 in your case), then you add an offset.

You might be interested in
Casey Griggs is a very capable computer engineer. Recently, he noticed a problem that computer engineers have, and thought of a
diamong [38]

Answer:

serendipitous

Explanation:

this happened by chance in a positive manner.  

8 0
4 years ago
Which icon will automatically adjust the amount of space between letters from very tight to very loose in style? Hyphenation, Te
tatuchka [14]
It's gonna be character spacing, as it allows you to customize how much space appears between characters.
5 0
4 years ago
Read 2 more answers
Brandon purchased a new processor online as an upgrade. When he purchased the processor, he made sure that it used the same sock
LenaWriter [7]

Answer:

The processor and the motherboard goes bad.

Explanation:

Computer system component upgrade allows the enhancement of the component specification. Every computer system comes with a specific quality, size or speed of its various components like the storage drives size, the memory size, the processor speed and even the software components like the operating system.

An upgrade must be compatible with the system configuration like upgrading the processor. If the upgrade is compatible, the processor speed can be increased, but when an upgrade of the processor is not compatible with the chipsets, this could damage the processor and motherboard.

3 0
4 years ago
Boolean logic deals with statements having one of _____ values.
Alexxandr [17]

Answer:

2 values

Explanation:

boolean statements can only be True or False

6 0
3 years ago
Select the correct answer. Which sign or symbol will you use to lock cells for absolute cell reference?
worty [1.4K]

Answer:

A. ampersand

Explanation:

7 0
3 years ago
Read 2 more answers
Other questions:
  • You have an old photograph that you want to incorporate in a brochure for your antique business. To convert the photo into digit
    9·2 answers
  • Find functions f1 and f2 such that both f1 and f2 are O(g(n)), but f1(n) is not O(f2)
    6·1 answer
  • Marilyn needs help exporting her spreadsheet as a few different types of files. She needs to know exactly how her file should be
    11·1 answer
  • Write a program that includes functions to calculate feet to inches, inches to feet, feet to yards, and yards to feet. Then, acc
    9·2 answers
  • Write a Unix (Linux) find-like command (myFind) in Python3 where the function will return the full paths of all the files contai
    9·1 answer
  • The entress Effie cooks as a chef never vary by taste, quantity or quality
    6·1 answer
  • Write a JAVA program containing a method called hasEight(), which takes an int as input and returns true if the number contains
    14·1 answer
  • In what order does the Cascade look at factors to determine which CSS rule to follow?
    14·1 answer
  • In what Career Cluster you get to design, build, and destroy things
    6·1 answer
  • SOMEONE PLEASE HELP ME OUT WITH!!!!!
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!