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
Malware is a combination of which two words? A. malevolent and software B. malignant and software C. maladapted and software D.
ladessa [460]

Answer:

D. Malicious and software

5 0
3 years ago
A university wants to install a client-server network. Which feature do you think is important for them as they set up the netwo
DENIUS [597]
The answer would be b andc
7 0
3 years ago
what is the greatest number of bits you could borrow from the host portion of a class b subnet mask and still have at least 130
Lina20 [59]

The greatest number of bits you could borrow from the host portion of a class b subnet mask and still have at least 130 host per subnet is 24.

<h3>What is a host bit?</h3>

Host bits are known to be the parts of an IP address that can state out a particular host in any subnet.

Note that whenever we take or borrow an host-bit, we can also double the number of subnets that we are said to create and as such, when we borrowing 2 host bits we can have 4 subnets.

Learn more about Bits from

brainly.com/question/19667078

6 0
2 years ago
Most network cards contain a port that accepts a(n) ____, which looks similar to a telephone connector but is larger.
Vadim26 [7]
YOUR ANSWER IS -------- It accepts a RJ-45 connector
hope i helped you :).
take care
8 0
3 years ago
Within a email address Wat is the Domain
GenaCL600 [577]
The domain name<span> part of an email address has to conform to strict guidelines: it must match the requirements for a </span>hostname<span>, consisting of letters, digits, hyphens and dots. </span>
6 0
4 years ago
Read 2 more answers
Other questions:
  • Într-o școală sunt n clase, fiecare având un număr diferit de elevi. Școală primește m pachete cu cărți, fiecare cu un număr dif
    15·1 answer
  • A coworker asks your opinion about how to minimize ActiveX attacks while she browses the Internet using Internet Explorer. The c
    14·1 answer
  • How many generations of computer languages have there been since the middle of the 20th century?
    9·2 answers
  • It is important that data being imported from a text file into access are separated by a character, such as a comma, which defin
    8·1 answer
  • What computer device works like a central nervous system?
    11·1 answer
  • When you search google for​ dishwashers, you are likely to see a number of inconspicuous ads for​ advertisers, including product
    11·1 answer
  • A(n) _____ can replace many applications with one unified set of programs, making the system easier to use and more effective.
    8·1 answer
  • WILL GIVE BRAINLIEST
    5·2 answers
  • By default, Outlook displays messages in the Content pane grouped by the
    13·1 answer
  • Trong mạng internet, chúng tôi thay đổi công nghệ mạng LAN sang một công nghệ
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!