Search This Blog

Sunday, 13 October 2013

Addtion Of two Numbers in java

import java.io.*;
class addition
{
    public static void main(String args[]) throws IOException
        {
             float no3;            
             DataInputStream in=new DataInputStream(System.in);
             System.out.println("enter  1st float value for addition:");
             float no1=Float.valueOf(in.readLine()).floatValue();
              System.out.println("enter  2nd float value for addition:");
             float no2=Float.valueOf(in.readLine()).floatValue();
                no3=no1+no2;           
              System.out.println("value of addition is:"+no3);
         }
       

ouput   

No comments:

Popular Posts