The Multiplication Table
I need help. I am working on a C# code coach that I do not understand. Basically, I am an elementary school teacher that explains multiplication to the students. I'll be using the multiples of 3 as my example. Here is the code: using System; using System.Collections.Generic; namespace SoloLearn { class Program { static void Main(string[] args) { int number = Convert.ToInt32(Console.ReadLine()); //your code goes here for (int x = 1; x < 3; x++) { if (number%3==0) { x = number*3; } Console.Write(x*number + "*"); } } } } Here is where I don't get it. On the result, it has to output the multiples of three. Here is where I'm confused: why does it output only 12 and 45? I'm generally confused on that. And if I'm on the right track on my code, what am I missing?