Answer Posted / rajender
private void btnCalculae_Click(object sender,
System.EventArgs e)
{
long number = Convert.ToInt64 (txtNumber.Text);
long factorial = 1;
lblFactorial.Text = factorial.ToString
("n20");
// calculate factorial
while ( number > 0 && number <= 20)
{
factorial *= number;
number++;
} // end while loop
txtNumber.Text = "";
txtNumber.Focus();
}
private void btnExit_Click(object sender,
System.EventArgs e)
{
this.Close();
}
}
}
| Is This Answer Correct ? | 10 Yes | 1 No |
Post New Answer View All Answers
What do u mean by delegation?
When should we use sealed class in c#?
What is the execution entry point for a c# console application?
Can I call a virtual method from a constructor/destructor?
How to find the current application file path while runtime?
Why to use “using” in c#?
How can I produce an assembly?
When should I use static in C#?
Is dictionary reference type c#?
Is list ienumerable c#?
In which way a two-dimensional array declared in C#?
What do you mean by object pooling?
Explain the process of inheriting a class into another class?
How do I register my code for use by classic com clients?
Explain the difference between the debug class and trace class?