Created
October 5, 2022 07:49
-
-
Save azeezco/de40bd5c34f6b384d0064b79e4851011 to your computer and use it in GitHub Desktop.
Console Calculator that performs arithmetic operations on two numbers
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(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