Beruflich Dokumente
Kultur Dokumente
Output
CHECKS IF A NUMBER ENTERED BY THE USER IS A MULTIPLE OF ANOTHER NUMBER ENTERED BY THE USER
Coding
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { int multiple,divisor; multiple=Integer.parseInt(jTextField1.getText()); divisor=Integer.parseInt(jTextField2.getText()); if(multiple%divisor==0) { JOptionPane.showMessageDialog(this,"Yes, the first number is a multiple of the second number");} else {JOptionPane.showMessageDialog(this,"No, the first number is not a multiple of the second number");} }
Concepts Used
If-Else statement Application | 13