Skip to content

Instantly share code, notes, and snippets.

@oriohac
Created October 7, 2022 03:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oriohac/862dce22dd19a58ac4c13d2800f2e3d8 to your computer and use it in GitHub Desktop.
Save oriohac/862dce22dd19a58ac4c13d2800f2e3d8 to your computer and use it in GitHub Desktop.
Calculator-weeek3-task

Calculator-weeek3-task

Created with <3 with dartpad.dev.

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