lundi 27 octobre 2014

How to send out multiple values from one function?


Vote count:

0




How would I be able to take in, say 2 values, and then output it through one function (which is supposed to do two different types of calculations with the same input values), so that I can output two different values?


So as an example, I have 2 inputs (ex: int a=2, and int b=5), and then I would do some calculations using them (1st one: (a+b)*2, 2nd one: (a-b)/2). I would normally use two functions for this, but how could I get them to be all under one function and yet still give me two different values?



asked 5 mins ago







How to send out multiple values from one function?

Aucun commentaire:

Enregistrer un commentaire