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
Explain the various types of classes used in c#?
How do you determine whether a string represents a numeric value?
Explain use of abstract and sealed classes in c#?
What is xml serializer?
Define a manifest in .net?
What is serialization of data?
Why do we need singleton class in c#?
Are arrays value types or reference types?
Can abstract class be instantiated c#?
What is the use of ispostback in c#?
How can I get the ascii code for a character in c#?
What is javascriptserializer c#?
What is overriding in c#?
Can a class be protected in c#?
Why do we need static in c#?