By making use of pseudocode, show the programming statements that will
accept two values from a user. These two values should be added together, and
the result displayed on the screen
package pseudocode;
import java.util.Scanner;
public class Pseudocode {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.println("Enter the first number");
int first = scan.nextInt();
System.out.println("Enter the second number");
int second = scan.nextInt();
System.out.println("The sum of the numbers is: "+(second+first));
}
}
Comments
Leave a comment