You are on page 1of 3

Accept Button

int Value, Limit,Product=0,i;

Value = Integer.parseInt(Value1.getText().trim());;

Limit = Integer.parseInt(Limit1.getText().trim());;

if(One.isSelected()){

Multipletable.setText("Normal Table" + "\n");

for(i=1; i<=Limit; i++)

Product = Value * i;

Multipletable.setText(Multipletable.getText()+ "\n" + Value + " x " + i + " = " + Product);


}

if(Two.isSelected()){

Multipletable.setText("Odd Table" + "\n");

for(i=0; i<=Limit; i++)

if(i%2==1){

Product = Value * i;

Multipletable.setText(Multipletable.getText()+ "\n" + Value + " x " + i + " = " + Product);

if(Three.isSelected()){

Multipletable.setText("Even Table" + "\n");

for(i=1; i<=Limit; i++)

if(i%2==0){

Product = Value * i;

Multipletable.setText(Multipletable.getText()+ "\n" + Value + " x " + i + " = " + Product);

Clear Button

Multipletable.setText(null);

You might also like