Skip to content

Instantly share code, notes, and snippets.

@azeezco
Created October 5, 2022 07:49
Show Gist options
  • Save azeezco/de40bd5c34f6b384d0064b79e4851011 to your computer and use it in GitHub Desktop.
Save azeezco/de40bd5c34f6b384d0064b79e4851011 to your computer and use it in GitHub Desktop.
Console Calculator that performs arithmetic operations on two numbers
void main() {
print(addTwoNumbers(2,5)); //7
print(subtTwoNumbers(2,5)); //-3
print(divideTwoNumbers(2,5).toInt()); //0
print(multTwoNumbers(2,5)); //10
print(moduTwoNumbers(2,5)); //2
}
int addTwoNumbers(int num1,int num2){
return num1+num2;
}
int subtTwoNumbers(int num1,int num2){
return num1-num2;
}
double divideTwoNumbers(int num1,int num2){
return num1/num2;
}
int multTwoNumbers(int num1,int num2){
return num1*num2;
}
int moduTwoNumbers(num1,num2){
return num1%num2;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment