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
Leni [432]
3 years ago
12

Implement RandMultipByVal function, which gets one integervariable as its argument

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

Answer:

#include <iostream>

#include <stdlib.h>

#include <time.h>

using namespace std;

void RandMultipByVal(int number){

   srand(time(NULL));

   int random = rand()%10+1;

   cout<<random*number;

}

int main()

{

 

  RandMultipByVal(4);

  return 0;

}

Explanation:

Include the three libraries, iostream for input/output, stdlib.h for rand() function and time.h for srand() function.

Create the function with one integer parameter.

Then, use srand() function. It is used to seed the rand() function or locate the starting point different in different time.

rand(): it is used to generate the random number between the range.

for example:

rand()%10  it gives the random number from 0 to 9.

if we add 1, then it gives from 1 to 10.

After that, multiply with parameter value and then print the result.

For calling the function create the main function and call the function with pass by value.

You might be interested in
Use the drop down menus to describe how adman can add shapes to his presentation
alina1380 [7]

Answer:

✔ Illustrations

✔ a crosshair

✔ left-click and drag

Explanation:

6 0
3 years ago
Carlos had 194 seeds and 11 flower pots he put the same number of seeds in each flower pot which is the best estimate for the nu
Inessa [10]

Answer:

20?

Explanation:

4 0
3 years ago
Studios had to forgo the theatre business in the late_1__ because of the rising theatre rents and advertising costs. Television
uysha [10]

Answer:

gfdhdf

Explanation:

6 0
3 years ago
Grade Co... ▶ Da'yana Stover - Aerospace Engineering.pdf
SVEN [57.7K]
The answer is Space shuttle.
8 0
1 year ago
Read 2 more answers
If user reading a document on computer, it allows you to navigate on any part of the document called?
VashaNatasha [74]
I Think Its either  B or C
6 0
3 years ago
Other questions:
  • Which of the following best describes cost-benefit analysis?
    9·1 answer
  • The Warn-on-Forecast has been developed by the National Weather Service to help predict hazardous weather earlier. Which of the
    10·2 answers
  • A student is going to give a multimedia presentation comparing the novel The Wizard of Oz by L. Frank Baum to the 1939 movie ver
    5·2 answers
  • Which one of these do not belong on the Do's list in Helpful Hints when preparing a presentation: Which one of these do not belo
    8·1 answer
  • Write a pseudocode that will take marks of physics, chemistry and math as input, calculates the average and displays output.
    7·2 answers
  • Well I am having trouble and I feel really bad because I helped RandomGuy1 who rubs it in my face that I gave him the wrong answ
    15·1 answer
  • 6. What is the difference between portrait and landscape orientation? What are the advantages of
    9·1 answer
  • Based on the condition.
    13·1 answer
  • science and technology are interdependent advances in one lead to advances in the other. give an example of this phenomenon.
    5·1 answer
  • Explain the evolution of programming language​
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!