/* Program to demonstrate Floating-point arithmetic */
class FloatPoint
{
public static void main(String args[ ])
{
float a=10.5F,b=6.1F;
System.out.println("a = "+a);
System.out.println("b = "+b);
System.out.println("a + b = "+(a+b));
System.out.println("a - b = "+(a-b));
System.out.println("a * b = "+(a*b));
System.out.println("a / b = "+(a/b));
}
}
class FloatPoint
{
public static void main(String args[ ])
{
float a=10.5F,b=6.1F;
System.out.println("a = "+a);
System.out.println("b = "+b);
System.out.println("a + b = "+(a+b));
System.out.println("a - b = "+(a-b));
System.out.println("a * b = "+(a*b));
System.out.println("a / b = "+(a/b));
}
}
0 comments:
Post a Comment