JOptionPane | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 3

JOptionPane

import java.util.Scanner; import javax.swing.JOptionPane; public class Main { public static void main(String[] args) { String question = JOptionPane.showInputDialog("la racine de 16"); Scanner in = new Scanner (System.in); int answer = in.nextInt(); do { question = JOptionPane.showInputDialog("la racine de 16"); }while(answer != 4); JOptionPane.showMessageDialog(null,"correct answer is "+answer); } }

12th Aug 2021, 12:13 PM
Mohammed Amine
Mohammed Amine - avatar
0 Answers