Ask Question
25 March, 12:40

Write a function that is named times_ten and accepts a number as an argument. When the function is called, it should return the value of its argument multiplied by 10.

+4
Answers (1)
  1. 25 March, 13:43
    0
    It changes a little depending on what programming language you're using, but in C you could say

    int times_ten (int num) {

    num = num*10;

    return num;

    }

    Or, in general terms:

    Integer Function times_ten (Integer num)

    Set num = num * 10

    Return num

    This is all done assuming the number used as an argument is an integer and that you are returning an integer value, not a decimal. The main thing to notice is that since you have to return a value, you must have two things: a return statement, and a type declaration for the function, otherwise you'll get an error.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Write a function that is named times_ten and accepts a number as an argument. When the function is called, it should return the value of ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers