Skip to content

Factorial AP

priyanshu singh

Asked Jun 17, 2013, 8:46 AM EDT1 answer
Share
LinkedInX
Here is a question for generating a series of factorial upto n terms. The input number of terms is taken from user.

1/1! + 2/2! + 3/3! + 4/4! + 5/5! + - - - - - - - + n/n!

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    i think i got the answer:

    C#
     public void fact(int x)
            {
                double fact = 1;
                int i = 1;
                while (i < x)
                {
                    fact += i/(fact * i);
                    i++;
                }
                MessageBox.Show(fact.ToString());
    
            }
    
    
            private void button1_Click(object sender, EventArgs e)
            {
                int a = int.Parse(textBox1.Text);
                fact(a);
            }
    0