HOW TO MAKE FACTORIAL USE THE FOLLOWING SCRIPT IN NETBEANS AND CHANGE TEXTFEILD NAME ACORDINGLY
SCRIPT FOR SUBMIT BUTTON
int n=Integer.parseInt(jTextField1.getText());
int i,factorial=1;
for (i=1;i<=n;i++)
{
factorial=i*factorial;
}
System.out.println(factorial);
No comments:
Post a Comment