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
Gennadij [26K]
3 years ago
13

Write the definition of a void function that takes as input an integer and outputs two times the number if it is even; otherwise

it outputs five times the number.
Computers and Technology
1 answer:
KatRina [158]3 years ago
6 0

Answer:

Written in C++

void number(int n){

if(n%2 == 0)

cout<<2 * n;

else

cout<<5 * n;

}

Explanation:

The programming language is not stated.

However, I answered using C++

This line defines the function as void

void number(int n){

This line checks if the number is even

if(n%2 == 0)

If yes, it doubles the number and prints the output

cout<<2 * n;

If otherwise,

else

It multiplies the number by 5 and prints the output

cout<<5 * n;

}

To call the function from main, use:

number(n);

Note than n must be declared as integer

See attachment

Download cpp
You might be interested in
Complete the body of the decrement static method using only the NaturalNumberKernel methods (multiplyBy10, divideBy10, and isZer
Ivan

Answer:true

Explanation:mark as brainliest

6 0
3 years ago
Something the user knows (ID and password); something the user has (such as a smart card, which is a credit card device storing
Vlad1618 [11]

Answer:

Secure Authentication involves a combination of the following three information

Explanation:

Generally, it is important that users have access to secure sources of information or data. These data will be used by the users to get access to their platform such as account details. The user should also be the only person that has access to his or her vital information. This should not be disclosed to any other person.

8 0
4 years ago
To conserve its public IP addresses, a company can instead use ____ addresses for devices within its own network boundaries.
Thepotemich [5.8K]

Answer:

private ip addresses

Explanation:

A private ip address is assigned to each device on a network, allowing devices on the same network to communicate with each other without using any public ip addresses.

7 0
2 years ago
Which is a sentence fragment?
ehidna [41]
C is a sentence fragment it does not have a verb
5 0
3 years ago
A_________is a way for students to keep track of information during research.
Fudgin [204]
Note pad your welcome


4 0
3 years ago
Other questions:
  • In Python, what kind of error is returned by the following code? (e.g. NameError, ValueError, IOError, etc.) def my_func(n1, n2)
    8·1 answer
  • he Saffir-Simpson Hurricane Scale classifies hurricanes into five categories numbered 1 through 5. Write an application named Hu
    10·2 answers
  • What is the Code of Conduct/Ethics for the company/of Department of Defense?
    7·1 answer
  • CodeHS 3.4.5. What is the code for four colored triangles.
    8·1 answer
  • Which of the following is a correct group scope type in AD, windows server 2016?
    6·1 answer
  • Write a Java program that creates a two-dimensional array of type integer of size x by y (x and y must be entered by the user).
    7·1 answer
  • What are some example of popular music for teenagers
    8·2 answers
  • ____________________________ and _________________________ are 2 positive impacts of the internet on businesses.
    14·2 answers
  • Which of the following is NOT one of the three main ways to control a program when writing code?
    6·2 answers
  • 2. What are some other reasons why you might need to know the operating system version on your computer or mobile device
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!