How do I get the "for" loop to give me one outcome?
hello! I am facing a problem within the beginner course of C#. You see, in the "for loops" lesson, the practice at the end requires you to write a code that calculate and output the factorial of an input. I did try many combinations. This is my last: using System; public class Program { static void Main(string[] args) { int num = Convert.ToInt32(Console.ReadLine()); //your code goes here for (int mercy=num--;mercy>1;mercy*=num--) Console.WriteLine(mercy); } } This one does grant me the correct final answer. Yet, being a loop, it does output all the other numbers prior to the answer. This, consequently, fail the test since it only wants the final outcome. I checked the lesson again and it doesn't show anything to help with this. In fact, it only has examples that does output all the numbers of the loop. I am stuck, I can't advance this way. If someone knows how to get me out of this. Please help! Thank you in advance.