Search For

Sum of Two Numbers

Flag Hide Line Nos
Flagging a Snippet, takes the snippet to Moderator Attention;


0
import java.io.*;
class Addition
{
public static void main(String args[])throws Exception
{
int a,b,c;
BufferedReader br= new BufferedReader( new InputStreamReader(System.in));
System.out.println("Enter the two numbers to add:");
a=Integer.parseInt(br.readLine());
b=Integer.parseInt(br.readLine());
c = a+b;
System.out.println("\nSum of two numbers:"+ c);
}
}



Output:
Enter the two numbers to add:
2
3
Sum of two numbers:5