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
Ryan has created a Word document to be used as a review quiz for students in a classroom setting. The document contains both que
kozerog [31]

Answer:

Include the answers on an additional sheet.

3 0
3 years ago
The third wave of computing was characterized by the introduction of _____.
MrRissso [65]

Answer:

personal computers

Explanation:

The third wave of computing was characterized by the introduction of <u>personal computers </u>

4 0
3 years ago
What are the four steps for planning a table?​
aleksley [76]

Answer:

1. Environmental Scanning. Environmental scanning is the process of gathering, organizing and analyzing information. ...

2. Strategy Formulation. ...

3. Strategy Implementation. ...

4. Strategy Evaluation.

Explanation:

4 0
3 years ago
Under which of the following conditions will evaluating this boolean expression
zzz [600]
1.) 
<span>((i <= n) && (a[i] == 0)) || (((i >= n) && (a[i-1] == 0))) </span>

<span>The expression will be true IF the first part is true, or if the first part is false and the second part is true. This is because || uses "short circuit" evaluation. If the first term is true, then the second term is *never even evaluated*. </span>

<span>For || the expression is true if *either* part is true, and for && the expression is true only if *both* parts are true. </span>

<span>a.) (i <= n) || (i >= n) </span>

<span>This means that either, or both, of these terms is true. This isn't sufficient to make the original term true. </span>

<span>b.) (a[i] == 0) && (a[i-1] == 0) </span>

<span>This means that both of these terms are true. We substitute. </span>

<span>((i <= n) && true) || (((i >= n) && true)) </span>

<span>Remember that && is true only if both parts are true. So if you have x && true, then the truth depends entirely on x. Thus x && true is the same as just x. The above predicate reduces to: </span>

<span>(i <= n) || (i >= n) </span>

<span>This is clearly always true. </span>
3 0
3 years ago
What does a file association specify?
Olenka [21]

Answer:

The answer is D

Explanation:

file association associates a file with an application capable of opening that file. More commonly, a file association associates a class of files with a corresponding application.

4 0
3 years ago
Read 2 more answers
Other questions:
  • The _____ command icon looks like a small clipboard with a page attached.
    6·1 answer
  • Describe an ergonomic consideration for your body while working for long periods in front of a monitor or computer screen?
    14·1 answer
  • Name three actions you can perform on an inserted image.
    7·2 answers
  • 2. Integer plot function (find a smart way to code big integers) Write a program BigInt(n) that displays an arbitrary positive i
    8·1 answer
  • Add a new row to a table by clicking in the
    10·1 answer
  • Alison is having a hard time at work because her Inbox is flooded with emails every day. Some of these emails are unsolicited. S
    15·2 answers
  • Write any four difference between email and effects​
    14·1 answer
  • Which picture should i put as my profile picture.
    15·2 answers
  • Write a function definition for a function which takes one parameter and returns twice that parameter
    12·1 answer
  • U $ er Ideas for R 0 B 1 0 X?
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!