Q1.
Application to input a number and display its reverse (using do…while loop)
private void clearActionPerformed(java.awt.event.ActionEvent evt) {
t1.setText ("");
t2.setText ("");// TODO add your handling code here:
}
private void exitActionPerformed(java.awt.event.ActionEvent evt) {
System.exit(0);
// TODO add your handling code here:
}
private void mirrorimageActionPerformed(java.awt.event.ActionEvent evt) {
int a = Integer.parseInt (t1.getText ());
int b = a; int d=0;
do {
int c = a%10;
d=d*10+c;
a = a/10;
}while(a!=0);
t2.setText ("Mirror Image Of " + b + " is " + d);