Skip to content

Commit 191542f

Browse files
committed
Added Calculator.java with basic operations
1 parent fd354a0 commit 191542f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package com.thealgorithms.misc;
2+
3+
public class Calculator {
4+
public int add(int a, int b) { return a + b; }
5+
public int subtract(int a, int b) { return a - b; }
6+
public int multiply(int a, int b) { return a * b; }
7+
public double divide(int a, int b) { return (b != 0) ? (double)a / b : 0; }
8+
}

0 commit comments

Comments
 (0)