Created
October 9, 2013 17:18
-
-
Save rfaisal/6904852 to your computer and use it in GitHub Desktop.
Simple math library in C#
This file contains hidden or 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
| public class MathServer | |
| { | |
| public MathServer() { } | |
| public int add(int a, int b) | |
| { | |
| Console.WriteLine("Called add({0},{1})={2}", a, b, a+b); | |
| return a + b; | |
| } | |
| public int sub(int a, int b) | |
| { | |
| Console.WriteLine("Called sub({0},{1})={2}", a, b, a - b); | |
| return a + b; | |
| } | |
| public int mul(int a, int b) | |
| { | |
| Console.WriteLine("Called mul({0},{1})={2}", a, b, a * b); | |
| return a + b; | |
| } | |
| public int div(int a, int b) | |
| { | |
| Console.WriteLine("Called div({0},{1})={2}", a, b, a / b); | |
| return a / b; | |
| } | |
| public int mod(int a, int b) | |
| { | |
| Console.WriteLine("Called mod({0},{1})={2}", a, b, a % b); | |
| return a % b; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment