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
Part of metacognition involves making a plan to address <br> .
Ray Of Light [21]

Answer:

weaknesses

Explanation:

hope this helps :)

8 0
2 years ago
Read 2 more answers
Firestick optimizing system storage and applications
Nat2105 [25]

seach up this on goggle many great videos will pop up

Explanation:

<3

7 0
2 years ago
An if statement must always begin with the word “if.” True False python
MrMuchimi

Answer:

true

Explanation:

6 0
3 years ago
Read 2 more answers
Which processor interrupts the system 18.2 times per second? What are some of its practical uses?
julsineya [31]

Answer:

timer interrupt

Explanation:

A timer is an interrupt that is generated by the PC's system timer.When this interrupt occurs, the ROM BIOS interrupt handler is called and it increments a count in the ROM BIOS.It interrupts the system 18.2 times per second.It is used for multitasking.Hence we conclude that timer interrupt is the answer.

6 0
3 years ago
Els
galina1969 [7]

Answer:

ds2d2d2d2dd

Explanation:

3 0
3 years ago
Other questions:
  • ​printers, monitors,​ tablets, cpus, and laptops are examples of​ ____________.
    14·1 answer
  • Wireless network devices use ________ to communicate with each other.
    9·2 answers
  • What is a good voltage measurement on a brand new, 6 volt golf cart deep cycle battery after the first charging?
    10·1 answer
  • A network security analyst received an alert about a potential malware threat on a user’s computer. What can the analyst review
    12·1 answer
  • A technician has just installed a video card in a PC. The video card is not working, althoughit was working fine on the test ben
    6·1 answer
  • What do you need to do before you can sort and filter data in a data base?
    12·1 answer
  • When using the Common Internet File System (CIFS), which security model does not require a password to be set for the file share
    7·1 answer
  • During system testing, developers test the program in an environment that is very similar to how the program will eventually be
    11·2 answers
  • Organizations can face criminal or civil penalties for being ______ in protecting their sensitive data.
    6·2 answers
  • In cell B20, enter a
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!