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 are c# i/o classes?
In which way you can convert a value-type to a reference-type?
What is anonymous types in c#?
What is difference between hashtable and dictionary in c#?
Why is c# a good programming language?
Is c# difficult to learn?
Does c# have primitives?
Explain the constructor in c#.
What is an int c#?
What is gac? What are the steps to create an assembly and add it to the gac?
Why constructor is used in c#?
State two different types of access modifiers.
what is the difference between interface and multiple interface?
Does c# support parameterized properties?
What is the Signification of the "new " keyword in C#? example