Net Beans Program to Find Factorial of A number

private void CalculateActionPerformed(java.awt.event.ActionEvent evt)
{                                         
       
        double N= Double.parseDouble(t1.getText());
        double F=1;
       
                  for(double i=N; i>=1;i--)
                          {
                                    F=F*i;
                          }  
                 r.setText("FaCtOrial = "+" "+ F);
       
            if (N==0)
            r.setText("Factorial = "+" "+"1");
}

Comments

Popular posts from this blog

Xtra Care Hospital Bill Generator

Net Beans Program to Check a Number Whether is it Prime or Not.

Net Beans program To Check Whether Given Number is Armsrong no. or not