Calculation in Java in Command Line. | Coding Startup

Calculation in Java in Command Line.

How to perform Calculation in Java in Command Line.

100% Working Code and Projects.

if you need any help about project and Application Contact Shelly at:+917888361589.


See the code below :-

Java Code  :-
class Calculation
{
public static void main(String []Abheer)
{
int a= Integer.parseInt(Abheer[0]);
int b= Integer.parseInt(Abheer[1]);
int c=a+b;
int d=a-b;
System.out.println("The sum of two number is :"+c);
System.out.println("The Subtraction of two number is :"+d);
}
}


Output :-


Explanation :-

                                       In this, we have use Integer.parseInt(Abheer[0]) just to convert the string value to Integer value because it cannot be converted itself.






  

Code Startup

Author & Editor

0 Comments:

Post a Comment