c# - Factorial task is incorrectly outputting zero -


I am having trouble in the dry part of a program, I can not find it, so my program is giving 0 in output . 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 zero main (string [] args) {int i = 3; Int c = i / fact (i); Console.light line ("is factorial:" + c); Console.ReadLine (); } Fixed int fact {if (value == 1) {return 1; } And {return (value * (fact (value - 1)); }}}}}  

You are dividing the integer variables you are 3 to 6 Are divided, which gets round in the next integer, which is zero.

Instead of getting that value, instead of 'int', type 'double' which you may be looking for.


Comments

Popular posts from this blog

asp.net - Change the driver in the connection string to a data source in VB.Net -

Getting started consuming web services in a Ruby on Rails 3 application -

objective c - iPhone and it's wireless area -