Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int Add()
- {
- return x+y;
- }
- int Subtact()
- {
- return x-y;
- }
- void divide(){
- if (y ==0){
- System.out.println("Cannot divide zero");
- }
- else{
- double ans = x/y;
- System.out.println("answer of division is: " +ans);
- }
- public class Calculation{
- int x, y;
- void calculation(int num1, int num2){
- x = num1;
- y= num2;
- }
- }
- int multiply(){
- return x*y;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement