write code for Factorial?

Answer Posted / sathish

private void btnCalculae_Click(object sender,
System.EventArgs e)
{
string str =txt1.text;
int fact=1;
foreach char c in str
{
fact=convert.toint32(c)*fact;
}
txt2.text=fact;
}

Is This Answer Correct ?    4 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is int32?

684


What exactly happens when we debug and build the program?

2359


How long has c# been around?

737


What is the difference between method and function in c#?

657


What is Dependency of Injection?

709


How does substring work in c#?

682


Can an int be negative c#?

776


What is the class in c#?

669


What does string format do?

645


What is a generic in c#?

678


Should I make my destructor virtual?

800


What is c# entity framework?

655


What is event delegate in c#?

810


What is instantiating a class in c#?

679


What are properties in c#. Explain with an example?

666