Skip to content

Instantly share code, notes, and snippets.

@rashedulemon
Last active June 7, 2018 11:12
Show Gist options
  • Select an option

  • Save rashedulemon/cb389ea34b088fca149927101ff31ac7 to your computer and use it in GitHub Desktop.

Select an option

Save rashedulemon/cb389ea34b088fca149927101ff31ac7 to your computer and use it in GitHub Desktop.
package input;
import java.util.Scanner;
public class Get_input {
@SuppressWarnings("resource")
public static void main(String[] args) {
Scanner scr = new Scanner(System.in);
System.out.println("Enter a number:");
int a = scr.nextInt();
System.out.println("Enter another number:");
int b = scr.nextInt();
int result = a + b;
System.out.println("The result:"+ result);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment