Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  calculator
Language: JAVA
Code:
import java.util.*;
public class calculator
{
    static int sum(int x1,int x2)
    {
        return x1+x2; 
    }
   /* Static int sub(int x3,int x4)
    {
        return x3-x4;
    }
    static int div(int x5,int x6)
    {
        return x6/x5;
    }
    static int mul(int x7,int x8)
    {
        return x7*x8;
    }*/
    public static void main(String []args)
    {  Scanner obj=new Scanner(System.in);
        System.out.println("enter the value of b");
        int b=obj.nextInt();
         System.out.println("enter the value of c");
        int c=obj.nextInt();
        int a=sum(b,c);
        System.out.println("addition is "+a);
 
    }
    }     
Comments: