calculating using variables java
Posted: Mon Mar 25, 2013 4:07 am
hey guys
this small snippet will help you understand how to calculate using variables ok now
proof
![Image]()
you can also use multiply and divide etc instead of addition :ugeek: now you can do calculations using variables in java cooll;
this small snippet will help you understand how to calculate using variables ok now
Code: Select all
integer x value is equal to 11 and integer y value is equal to 100 and z value is x and y that mean z will get the total of x and y class variables
{
public static void main(String args[])
{
int x=11;
int y=100;
int z;
z = x+y;
System.out.println("The Answer Is : " + z);
}
}
proof

you can also use multiply and divide etc instead of addition :ugeek: now you can do calculations using variables in java cooll;