// simple_add_of_float_number
import java.io.*;
class simple_add_of_float_number
{
public static void main(String args[])
{
float a,b,c;
try
{
DataInputStream cin=new DataInputStream(System.in);
System.out.println("Enter the first float number ");
a=Float.parseFloat(cin.readLine()); // load first number
System.out.println("Enter the second float number ");
b=Float.parseFloat(cin.readLine()); // load second number
c=a+b;
System.out.println(a+" + "+b+" = "+c);
}
catch(Exception e)
{
System.out.println("wrong data");
}
}
}
No comments:
Post a Comment