ADD TWO NUMBERS

import java.util.*;
class SUM
{
public static void main(String args[])
{
Scanner st=new Scanner(System.in);
int a,b,sum;
System.out.println("ENTER THE FIRST NUMBER");
a=st.nextInt();
System.out.println("ENTER THE SECOND NUMBER");
b=st.nextInt();
sum=a+b;
System.out.println("sum:"+sum);
}
} 
OUTPUT:
ENTER THE FIRST NUMBER
12
ENTER THE SECOND NUMBER
12
sum:24

Translate »