Skip to content

Instantly share code, notes, and snippets.

@mohnoor94
Created August 20, 2017 21:21
Show Gist options
  • Select an option

  • Save mohnoor94/7997034947a85a2f39a1a252b3e5800a to your computer and use it in GitHub Desktop.

Select an option

Save mohnoor94/7997034947a85a2f39a1a252b3e5800a to your computer and use it in GitHub Desktop.
A function that takes 2 integer variables x and y, returns the multiplication of x and y in variable mul, and the division of x and y in variable div.
// www.abukhleif.com
void multiplyAndDivide (int x, int y, int& mul, double& div) {
mul = x * y;
div = (x * 1.0) / y;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment