1. How to add two floating numbers in java
public class AdditionFloatValues
{
public static void main(String args[])
{
float a=20.54f,b=50.732f,c;
c=a+b;
System.out.println("c="+c);
}
}
OUTPUT:
c=71.272
public class AdditionFloatValues
{
public static void main(String args[])
{
float a=20.54f,b=50.732f,c;
c=a+b;
System.out.println("c="+c);
}
}
OUTPUT:
c=71.272
No comments:
Post a Comment