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
Tatiana [17]
3 years ago
11

Write a program that calls a function to change a variable value from miles to kilometers.

Computers and Technology
1 answer:
Aneli [31]3 years ago
7 0

Answer:

#include <iostream>

using namespace std;

void miles_to_km(float &miles)//function to convert miles to kilo meters.

{

   miles=miles*1.6;

}

int main() {

   float miles;

   cout<<"Enter the miles"<<endl;

   cin>>miles;//taking input of the miles..

  miles_to_km(miles);//calling function that converts miles to km..

   cout<<"The number of km is "<<miles<<endl;//printing the km.

return 0;

}

Output:-

Enter the miles

54

The number of km is 86.4

Explanation:

I have created  a function miles_to_km of type void which has the argument miles passed by reference.In the function the variable miles is converted to kilo meters.Then in the main function the function is called with the value prompted from the user.Then printing the changed value.

You might be interested in
A web directory is a web page that conducts searches of the web to find the words or expressions that you enter? true or false.
Sav [38]
The answer to this is true! hope i helped!
4 0
3 years ago
An example of a current disruptive technology is a?
guapka [62]
Smart Watches are taking over normal watches. They are getting WAYYY cheaper. There is one for about $14
6 0
3 years ago
Read 2 more answers
Hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
uysha [10]

Answer:

hhhhhhhhhhh

hhhhhhhjjjhh

8 0
3 years ago
Read 2 more answers
write a C++ program that requires the user to enter two-digit positive and negative integers . The program counts the number of
ValentinkaMS [17]

Answer:

Use GitHub it helps a lot

Explanation:

4 0
3 years ago
In a four-stroke engine, the time period when both valves are slightly open is called valve
Thepotemich [5.8K]
Answer to my knowledge is d. overlap
3 0
3 years ago
Other questions:
  • Were Al Zink’s actions that of someone trying to be an invisible Sponsor
    14·1 answer
  • A(n) ________ is a variable that receives an argument that is passed into a function. global argument scope parameter
    15·1 answer
  • ZeroIt is a function that takes one argument and returns no value. The argument is a pointer to int. The function stores the val
    15·1 answer
  • It is always better to run over and give more information when you are giving a presentation versus quitting on time. true false
    15·2 answers
  • Select the recommended design practice that applies to a web site using images for main site navigation.
    7·1 answer
  • The director of HR realizes that the KSAs currently used for hiring entry-level engineers are outdated. In order to establish wh
    5·1 answer
  • All computers perform disk optimization utilizing the same software.<br><br> true <br> false
    11·1 answer
  • To combine concepts or ideas into a whole is called
    11·2 answers
  • 6
    14·1 answer
  • What is connected to the base unit in Desktop PC?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!