| Muzamil (4) | |
|
Can you guys tell me what I'm making mistake I want to display output as Enter the number : 4 Factorial of 4 is : 1 x 2 x 3 x 4 = 24! using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Factorial { class fact { public int[] factorial(int num) { int[] fact = new int[10]; for (int i = 0; i < num; i++) { fact[i] = fact[i] + i; } return fact; } } class fact { static void Main(string[] args) { fact num1 = new fact(); int num; int[] result; num = Convert.ToInt32(Console.ReadLine()); result = num1.factorial(num); for (int i = 0; i < num; i++) { Console.Write(result[i]); Console.WriteLine(); Console.WriteLine(); } } } } | |
|
|
|