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
Does the system.exception class have any cool features?
How does aspect oriented programming work?
Why do we use dataset in c#?
Hello! How to do this: "Create manifest utility intended for creating update content files. Application should take a set of files as input parameter and generate XML based manifest file as output one." I use C# and vs.net 2003. It's urgent! Help please, thanks. Mayana
What is the purpose of private constructor in c#?
How do you mark a method obsolete?
How can I make sure my c# classes will interoperate with other .net languages?
What is difference between override and new in c#?
What is array and arraylist?
Which property of the textbox cannot be changed at runtime?
What is the difference between interface and inheritance in c#?
What are custom exceptions?
In which format you can pass the value in the sleep function?
Does c# do array bounds checking?
What is desktop application testing?