Tuesday, February 11, 2014

Write a program of Addition of two numbers using Stream concept.

import java.io.*;
class Asignment12
{
public static void main(String surat[]) throws IOException
{
InputStreamReader i=new InputStreamReader(System.in);
BufferedReader br=new BufferedReader(i);

int a=0;
int b=0;
int c;

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

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

c=a+b;

System.out.println("Addition : "+c);
}
}

Output:

No comments:

Post a Comment