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
How many types of constructors are available in c#?
Is enum a value type c#?
What is sqldataadapter in c#?
How do you create user defined data types in c#?
In which order the destructor is called for an inherited class?
What is the difference between const and static read-only?
Major difference between Basic httpbinding and WShttpbinding?
What is callback function in c#?
What's the difference between a method and a procedure?
How many types of methods are there in c#?
What does int32 mean?
What are mutable and immutable types in c#?
What does void mean in c#?
What is addressof operator?
How do I unload an assembly?