//How to add two double datatype values without using third variable in java
public class M
{
public static void main(String args[])
{
double a,b;
a=45.0215;
b=458.25468;
System.out.println("Sum = "+(a+b));
}
}
OUTPUT:
Sum = 503.27618
public class M
{
public static void main(String args[])
{
double a,b;
a=45.0215;
b=458.25468;
System.out.println("Sum = "+(a+b));
}
}
OUTPUT:
Sum = 503.27618
No comments:
Post a Comment