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
You can use a(n) to call a function in response to an event?
uranmaximum [27]

Answer:

Simply put: A callback is a function that is to be executed after another function has finished executing — hence the name 'call back'. ... Functions that do this are called higher-order functions. Any function that is passed as an argument is called a callback function.

Explanation:

6 0
2 years ago
What did Adam and Eve look like?
Nata [24]
No one could possibly know, unfortunately.
6 0
3 years ago
Read 2 more answers
Several of the items below indicate the steps required to move a slide to a different location in a presentation. Select those s
Llana [10]

Answer:

1 - Select the slide you want to move

2- Hold down the mouse button

3- Drag the slide where you want it

4 - NA

5- NA

6- NA

Explanation:

1 - Select the slide you want to move

it allows us to select the slide which we want to move by just clicking left mouse button

2- Hold down the mouse button

it allows the selected slide to stick with cursor

3- Drag the slide where you want it

It allows the slide stick with the cursor to drag it by moving the cursor to the required position

4 - NA (Choose move from the toolbox menu)

There is on toolbox against the slide as toolboxes are only available within a slide that is what we are writing on the slides

5- NA (Enter the slide position you want)

There is no command line in which we may enter the slide position to move the slide to a different serial number

6- NA (Switch to the Notes view)

Switching to notes view allows us to write notes with the corresponding slide whereas it doesn't do anything related to moving the slide

5 0
3 years ago
software that instructs the computer how to run applications and controls the display/keyboard is know as the___.
kakasveta [241]
The answer is the alu arithmetic logic unit.
8 0
3 years ago
Armando is trying to decide how he will alert players that the game is over in the new video game that he is designing. He is co
mojhsa [17]

Answer:

He is working on the outcome

Explanation:

Because this is the outcome if you fail or die and the other objectives are the following

operation: A single objective in a level of the the whole game

obstacles: Trying to stop the player like blocks or walls or traps

objective:The main goal of the game

8 0
2 years ago
Other questions:
  • What are the first and the last physical memory addressesaccessible using
    10·1 answer
  • Face book requires you to change your password regularly<br> a. TRUE<br> b. FALSE
    14·1 answer
  • You have noticed that one of your DNS servers has possibly been compromised. You believe that a cached DNS entry for your domain
    8·1 answer
  • Which window allows you to view and change your computer's system information and settings?
    9·2 answers
  • ____ are designed to be used with everyday objects, such as home appliances, gaming consoles, digital cameras, e-readers, digita
    12·1 answer
  • Who initially developed what is now known as the internet?
    5·1 answer
  • Question # 1
    12·2 answers
  • Explain to Alana why she might not want to blast her boss on social media just yet.<br>​
    6·1 answer
  • Please tell fast plzzzzzzzz​
    9·2 answers
  • Your friend Cameron’s little sister is visually impaired. Cameron is worried that his sister will not be able to use technology
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!