Advertisement
Guest User

Nevin imkisser hafna

a guest
May 6th, 2015
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.48 KB | None | 0 0
  1.  
  2.     int Add()
  3.     {
  4.         return x+y;
  5.     }
  6.     int Subtact()
  7.     {
  8.         return x-y;
  9.     }
  10.     void divide(){
  11.     if (y ==0){
  12.         System.out.println("Cannot divide zero");
  13.     }
  14.     else{
  15.         double ans = x/y;
  16.         System.out.println("answer of division is: " +ans);
  17.     }
  18.    
  19. public class Calculation{
  20.         int x, y;
  21.     void calculation(int num1, int num2){
  22.      x = num1;
  23.      y= num2;
  24.     }
  25. }
  26.          int multiply(){
  27.      return x*y;
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement