How to perform Calculation in Java program.
100% Working Code and Projects.
if you need any help about project and Application Contact Shelly at:+917888361589.
See the code below :-
class Calculation
System.out.println("The Multiplication of two number is :"+e); }
The Addition of two number is :12
Java Code :-
class Calculation
{
public static void main(String []Abheer)
{
int a=12;
int b=12;
int c=a+b;
int d=a-b;
int e=a*b;
System.out.println("The Addition of two number is :"+c);
System.out.println("The Subtraction of two number is :"+d);
System.out.println("The Multiplication of two number is :"+e); }
}
Output :-
The Addition of two number is :12
The Subtraction of two number is :0
The Multiplication of two number is :144
Explanation :-
In this , int is a data type and a,b,c,d,e are variables which store some value. Now System.out.println() is use to print the data and message on the output window and here we use '+' to join the message and value which has to print.
0 Comments:
Post a Comment