1.

Write a program to accept an integer value in a jTextField1 and append all odd and even numbers in two different jTextArea respectively.

Answer»

The code is as follows: 

Int n; 

n = Integer.parseInt(TextField1.getText()); 

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

If (i%2!=0) 

jTextArea1.append(i+”\n”); 

else 

jTextArea2.append(i+”\n”);

}



Discussion

No Comment Found

Related InterviewSolutions