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
Which leader of the Jamestown colony am I?
faltersainse [42]
I am not completely sure, but I believe that the leader of the Jamestown colony described in this paragraph is John Rolfe.
7 0
4 years ago
Read 2 more answers
In Scratch, you have to choose backdrops from a limited number in the Scratch image library.
forsale [732]
I would say it would be True
5 0
3 years ago
Analyze a software application that enables people to purchase prescription drugs on the internet. briefly describe this applica
stiv31 [10]
This question makes no sense
8 0
3 years ago
I need some questions and answers in spreadsheet​
yarga [219]

Answer:

you need to show what you need help with

Explanation:

5 0
3 years ago
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
Alekssandra [29.7K]

Answer:

C.

Explanation:

A line graph can show how both the movie and the novel are compared to each other. It can give a visual of both mediums of the story rather than one or the other. Hope this helped :)

3 0
3 years ago
Read 2 more answers
Other questions:
  • ________ sets up a point-to-point connection between two computer systems over an Internet Protocol (IP) network. A. Point-to-Po
    15·1 answer
  • What is the term for the process of gathering information through images taken at a distance?
    13·1 answer
  • A _____ describes two or more computers connected to each other.
    9·2 answers
  • How can I collect tweets from different accounts concurrently and categorize the tweets in a corpus?
    15·1 answer
  • Project using simple formulas
    15·1 answer
  • What is the film format that many filmmakers feel is superior to any other format?
    13·1 answer
  • You will be creating a quiz grading program. You will compare the student's answers with the correct answers, and determine if t
    15·1 answer
  • Which of the following prefixes would be best to use when measuring your own mass?
    15·1 answer
  • What are the steps to open the Custom AutoFilter dialog box?
    5·2 answers
  • What are the four steps for planning a table?​
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!