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

Can an abstract class inherit from another abstract class c#?

544


List the difference between the virtual method and the abstract method?

489


How to properly clean up excel interop objects?

500


Is c# queue thread safe?

495


Why do we need constructors?

493






What is verbatim string?

501


Do loops c#?

499


When was .net linq added?

513


Define xslt.

544


Why do we need escape characters?

481


What are the various components in crystal reports?

499


How do you create user defined data types in c#?

525


What framework is used for performance testing/load testing?

1480


How do you convert byte array to hexadecimal string, and vice versa?

531


Explain the features of an abstract class in net.

499