Declaration part:
public
static
string
strvalue;
|
public static string res;
Function/Method:
#region Square Root public static string squareRoot(double fv, double sv) { double Result; for (int idx = 1; idx < sv+1; idx++) { if (idx == 1) { Result = Math.Pow(fv, idx); res = Convert.ToString(Result); } else if (idx > 1) { Result = Math.Pow(fv, idx); res = res + "," + Convert.ToString(Result); } } strvalue =res; return strvalue; } #endregion Square Root Call function in Your Application : string str = squareRoot(2, 10); MessageBox.Show(str); |
No comments:
Post a Comment