Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Sumof3{
- public static void main (String[] args ) {
- Scanner reader = new Scanner(System.in);
- int sum = 0;
- int read;
- System.out.println("Type a number: ");
- int read = Integer.parseInt(reader.nextLine());
- sum = read;
- System.out.println("Type another number: ");
- int read = Integer.parseInt(reader.nextLine());
- sum = sum + read;
- System.out.println("Type another number: ");
- int read = Integer.parseInt(reader.nextLine());
- sum = sum + read;
- System.out.println("Sum: " + sum);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement