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
Ymorist [56]
3 years ago
6

How do you return a value from a function?

Computers and Technology
1 answer:
rjkz [21]3 years ago
4 0

Answer:

return instruction used to return a value from a function.

Explanation:

Function is a block of statement which perform the special task.

Syntax for define a function:

type name(parameter_1, parameter_2,...)

{

  statement;

return variable;

}

In the syntax, type define the return type of the function. It can be int, float, double and also array as well. Function can return the array as well.

return is the instruction which is used to return the value or can use as a termination of function.

For return the value, we can use variable name which store the value or use direct value.

You might be interested in
You have recently completed IPAM installation and configuration. You have several each of DHCPservers, DNS servers, and domain c
Lina20 [59]

Answer:

The option(4) is the correct answer to the given question .

Explanation:

The main objective of the IPAM server is providing the Stand-alone deployment and incorporated the Orion Framework also the IPAM server manages the ipv4 and ipv6 domains of the servers .

If their is no DHCP servers are being seen in the inventory of IPAM server we have the uninstalling the DHCP server in the IPAM server because After uninstalling the files the removed and correct files are  restored in the IPAM server .

Others Options are incorrect because they are objective of IPAM server Others Options do not solved the problem of view Inventory .So option(4) is the correct way to solve the problem .

4 0
4 years ago
Assume that word is a variable of type string that has been assigned a value. Write an expression whose value is a string consis
Helga [31]

Answer:

Explanation:

The language I use would do it as

h1$ = copy(h$,1,3)

This may not satisfy you, because your language could be quite different. You might want an input statement of some kind that would define h$. This assumes that somewhere h,h1 are declared as  strings.

You also have to know how to read an input. My language uses readln(input,h)

and how to write it on the screen write(h1) or writeln(h1)

6 0
3 years ago
Write a program that prompts the user to enter a fraction in the following format (x/y). You may assume that the user will input
qaws [65]

Answer:

fraction = input("enter fraction x/y: ")

if len(fraction) == 3:

   if fraction[1] == "/":

       try:

           num = int(fraction[0])

           den = int(fraction[2])

           if num < den:

               print(f"{num}/{den} is a proper fraction")

           else:

               if num% den == 0

                   print(f"{num}/{den} is an improper fraction and can be reduced to {num/den}")

               else:

                   print(f"{num}/{den} is an improper fraction and can be reduced to {num//den} + {num - (den * (num//den))}/{den}")

       except ValueError:

           print("numerator and denominator must be integer numbers")

Explanation:

The try and except statement of the python program is used to catch value error of the input fraction of values that are not number digits. The program converts the numerator and denominator string values to integers and checks for the larger value of both.

The program prints the fraction as a proper fraction if the numerator is lesser and improper if not.

5 0
3 years ago
How can you tell that a website is not objective?
attashe74 [19]
Look at the website address for clues to help you asses the objectivity (and authority) of a website.
5 0
4 years ago
Read 2 more answers
Write a program that will compare two names. The program prompts the user to enter two names for a comparison. If the names are
asambeis [7]

Answer:

We can use comparison operator 'Equals to' (==) to compare two strings.

Explanation:

We can use conditional statement 'if else' to put conditions. If statement contains boolean expression.If statement is followed by else block. If the boolean expression evaluates to true, then the if block of code is executed, otherwise else block of code is executed.

If we want to compare two strings with uppercase, then we can convert the input strings given by users using ToUpper() string function.

For example,

 string abc;

string uppercase= abc.ToUpper(); // gives ABC as result

I have written a program using c# as a  programming language in a word document and attached the same. Please find. Thank you!

Download doc
5 0
4 years ago
Other questions:
  • Question 2: Sum of consecutive odd View Past Answers No past answers. Write a program which asks user to enter an integer n, cal
    8·2 answers
  • Feature of electric circuit​
    14·2 answers
  • Write the definition of a function printDottedLine, which has no parameters and doesn't return anything. The function prints to
    10·1 answer
  • your computer running Windows 10 is doing some very strange things with operating system you are fairly certain it is not a hard
    13·2 answers
  • You are the network adminstrator for your company your network consists of two active directory domains research.westsim.local a
    12·1 answer
  • When would you use the AutoFit to Contents option?
    15·1 answer
  • In PKI, the CA periodically distributes a(n) _________ to all users that identifies all revoked certificates.
    13·1 answer
  • BIOS has two jobs. One is to boot up, or start, the computer. What is the other? Maintain the computer’s software firewall. Ensu
    5·1 answer
  • Create a python code with 5 circles, 5 polygons, 5 line commands, 2 for loops, and 1 global variable
    12·1 answer
  • A museum is evaluating historical documents for authenticity, reviewing their physical condition, and categorizing them by subje
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!