Tuesday, February 11, 2014

Another program of Addition of two numbers using Stream concept.

import java.io.*;

public class Asignment12
{
public static void main(String surat[]) throws IOException
{
DataInputStream d=new DataInputStream(System.in);

System.out.print("A: ");
int a =Integer.parseInt(d.readLine());

System.out.print("B: ");
int b = Integer.parseInt(d.readLine());

int c=a+b;
System.out.println("Addition : "+c);
}
}

Output:

No comments:

Post a Comment