Created with <3 with dartpad.dev.
Created
October 7, 2022 03:53
-
-
Save oriohac/862dce22dd19a58ac4c13d2800f2e3d8 to your computer and use it in GitHub Desktop.
Calculator-weeek3-task
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
void main() { | |
print(add(5, 6)); | |
//adds 5 and 6 | |
print(sub(5, 6)); | |
//subtract 6 from 5 | |
print(mul(8, 2)); | |
//multiply 8 by 2 | |
print(div(8, 2)); | |
//divide 8 by 2 | |
print(mod(9, 2)); | |
//return the remainder from 9 after being divided by 2 | |
} | |
num add(num num1, num num2) { | |
return num1 + num2; | |
} | |
num sub(num firstNum, num secondNum) { | |
return firstNum - secondNum; | |
} | |
num mul(num val1, num val2) { | |
return val1 * val2; | |
} | |
num div(num number1, num number2) { | |
return number1 / number2; | |
} | |
num mod(num num1, num num2) { | |
return num1 % num2; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment