Addition of Three Numbers in Java

Addition of Three Numbers in Java



import java.util.Scanner;

class AddNumbers
{
public static void main(String args[])
{
int a, b, c, d;

System.out.println("Enter two integers to calculate their sum ");
Scanner in = new Scanner(System.in);

a = in.nextInt();
b = in.nextInt();
d = a + b + c;
System.out.println("Sum of entered integers = "+d);
}
}

Comments