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 you prevent a class from being instantiated?

596


Why generics are used in c#?

491


Why is c# better than java?

504


C# called c sharp why?

556


Does the system.exception class have any cool features?

511






How long does it take to learn c# for unity?

487


What is data set in c#?

502


What is the difference between selection and projection?

456


Explain Direct CAST vs CType ?

556


What are methods c#?

486


How to use exception handling in stored procedure?

546


Structs are largely redundant in c++. Why does c# have them?

757


What is the difference between public, static, and void?

483


Which control cannot be placed in mdi?

531


What is the adv of using System.Text.StringBuilder over System.String?

541