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 is meant by console programming?
What is private void in c#?
Can we store different data types in arraylist in c#?
Which is faster dictionary or hashtable?
What is the difference between wrapper class and primitive?
Can an abstract class inherit from another abstract class c#?
Define acid rule of thumb for transactions in c#.
What is difference between Trace and Debug
What Happens In Memory When You Box And Unbox A Value-type?
Is array value type in c#?
What is meant by generics in c#?
how can one use hcl and c sharp together?
Explain “static” keyword in c#?
How can I get around scope problems in a try/catch?
How does one compare strings in c#?