Skip to content

Instantly share code, notes, and snippets.

@tuxcuiabano
Created February 20, 2019 18:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tuxcuiabano/c6f1a744475a0fc8527320265eabd145 to your computer and use it in GitHub Desktop.
Save tuxcuiabano/c6f1a744475a0fc8527320265eabd145 to your computer and use it in GitHub Desktop.
Esse código faz.........
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package deitel14;
import javax.swing.JOptionPane;
/**
*
* @author tuxcuiabano
*/
public class Adicao {
public static void main( String[] args )
{
String primeiroNumero =
JOptionPane.showInputDialog( "Digite o primeiro número" );
String segundoNumero =
JOptionPane.showInputDialog( "Digite o segundo número" );
int num1 = Integer.parseInt( primeiroNumero );
int num2 = Integer.parseInt( segundoNumero );
int sum = num1 + num2;
JOptionPane.showMessageDialog( null, "A soma é " + sum,
"Soma de dois Inteiros", JOptionPane.PLAIN_MESSAGE );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment