To Find A Palladrom Number
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt)
{
R.setText("");
int N = Integer.parseInt(t1.getText());
int a1 = N;
int q,r;
while (N!=0)
{
q= N/10;
r=N%10;
N=q;
R.append(""+r);
}
int C = Integer.parseInt(R.getText());
if (C==a1)
R.setText("A Palladrom Number");
else
R.setText("Not a Palladrom Number");
{
R.setText("");
int N = Integer.parseInt(t1.getText());
int a1 = N;
int q,r;
while (N!=0)
{
q= N/10;
r=N%10;
N=q;
R.append(""+r);
}
int C = Integer.parseInt(R.getText());
if (C==a1)
R.setText("A Palladrom Number");
else
R.setText("Not a Palladrom Number");
Comments
Post a Comment