This Java program takes in two integers as input from the user, adds them together, and prints the sum. It imports the Scanner utility, declares integer variables x, y, and z, prompts the user to enter two numbers, stores the input in x and y, calculates z as the sum of x and y, and prints the statement "Sum of the integers=" followed by the value of z.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
34 views
Source Code
This Java program takes in two integers as input from the user, adds them together, and prints the sum. It imports the Scanner utility, declares integer variables x, y, and z, prompts the user to enter two numbers, stores the input in x and y, calculates z as the sum of x and y, and prints the statement "Sum of the integers=" followed by the value of z.