c# - How do I add the result of factorial values? -


I have a logic problem here I want to add the result of factual values, but I'm not sure how to add them. Here's my code:

  using the system; Using System.Collections.Generic; Using System.Linq; Using System.Text; Namespace Task_8_Set_III {Class Program {Static Wide Men (String [] AGR) {For (EyeI = 1; I and LT; = 7; I ++) {Double C = I / IT (I); Console.light line ("is factorial:" + c); Console.ReadLine (); Console.print line ("add up"); }} Fixed double facts (double values) {if (value == 1) {return 1; } And {return (value * (fact (value - 1)); }}}}}  

Not sure that this is what you have for N You want to sum up all the parameters to that value, in this way you do it.

  using the system; Using System.Collections.Generic; Using System.Linq; Using System.Text; Namespace Task_8_Set_III {Class Program {Static Zero Main (string [] ARG) {double total = 0; For (int i = 1; i & lt; = 7; i ++) {double c = i / fact (i); Yoga + = C; Console.light line ("is factorial:" + c); Console.ReadLine (); Console.print line ("adding .." + yoga); }} Fixed double facts (double values) {if (value == 1) {return 1; } And {return (value * (fact (value - 1)); }}}}  

Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -