Created
October 11, 2022 21:47
-
-
Save George-smart/da7586ba546cc0375c3cd1369cb2a1f3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Addition Function | |
int addition(int num1, int num2) { | |
return (num1 + num2); | |
} | |
// Subtraction Function | |
int subtraction(int num1, int num2) { | |
return (num1 - num2); | |
} | |
// Division function | |
double division(int num1, int num2) { | |
return (num1 / num2); | |
} | |
// Multiplication Function | |
int multiplication(int num1, int num2) { | |
return (num1 * num2); | |
} | |
// Modulus function | |
int modulus(int num1, int num2) { | |
return (num1 % num2); | |
} | |
void main() { | |
int num1 = 12; | |
int num2 = 3; | |
int result; | |
// call the functions | |
result = addition(num1, num2); | |
print(result); | |
result = subtraction(num1, num2); | |
print(result); | |
double total = division(num1, num2); | |
print(total); | |
result = modulus(num1, num2); | |
print(result); | |
result = multiplication(num1, num2); | |
print(result); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment