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
Nina [5.8K]
3 years ago
7

How can i take out a random (double) number in between 5.0 to 15.0 in c++?

Computers and Technology
1 answer:
ollegr [7]3 years ago
3 0

Answer:

#include <iostream>

using namespace std;

int main() {

   srand(time(0));

   for(int i=0;i<5;i++)

   {

      double f = (double)rand() / RAND_MAX;//generating random numbers.

       double a= 5.0 + f * (15.0 - 5.0);//random numbers in range provided.

       cout<<a<<" ";

   }

return 0;

}

Explanation:

The above program generate five random numbers in the range 5.0 to 15.0.The function rand() is used to generate random numbers.First we have to call srand(time(0)) otherwise the rand() function will generate same random numbers over and over every time.

You might be interested in
Who are the founders of Microsoft?
vekshin1

Answer:

Bill Gates, Paul Allen

Explanation:

The two founders of the mega-tech giant are Bill Gates, and Paul Allen. Hope this helps!

8 0
4 years ago
Jack was shocked to witness the sudden drop in performance of his laptop. He also found that the screen saver constant changed a
djyliett [7]

Answer: bootkit

This is the answer because the hacker was not trying to get any private information, so a bootkit would be the correct answer. A bookit uses a program to basically destroy your computer from the inside, starting from the motherboard.

Hope this helps!

8 0
3 years ago
L a s t. i achieve 15 of 15 question on brainly.
Veseljchak [2.6K]
The Control key on a computer keyboard is a key that is used by pressing it in combination with other keys, enabling other keys on the keyboard to perform secondary functions. It is generally labeled as Ctrl.
4 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
I GOT A 65% LAST TIME AND IM DOING RETAKE! PLEASE DONT FAIL ME THIS TIME
yawa3891 [41]

Answer:

Explanation: c vecause am pro

4 0
3 years ago
Read 2 more answers
Other questions:
  • Click ____ to move a stacked object to the top of the stack. Move to Top Bring to Front Slide to Top Move to Front
    12·1 answer
  • Write a program that reads in two integers typed on the keyboard and outputs their sum, difference, and product.
    12·1 answer
  • escribe and explain at least three improvements you think came about with the introduction of intrusion prevention technology. J
    10·1 answer
  • How and why do engineers use models?
    15·1 answer
  • How are codecs related to audio file formats?
    9·1 answer
  • PLEASE HELP me with at least 1 of the problems in the picture <br><br>We are coding using python​
    14·1 answer
  • An error in the sequence of words or rules in a program that prevents the program from running is what?
    10·2 answers
  • Which of the following is a document view you can select using Button on the status bar?
    11·1 answer
  • How do we find the time complexity for this algorithm?
    6·1 answer
  • A computer lacks a division instruction and performs iteratively using the technique described on page 300. suppose we wish to e
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!