Any idea on how to solve this? [SOLVED]
You are an elementary school teacher and explaining multiplication to students. You are going to use multiplication by 3 as your example. The program you are given takes N number as input. Write a program to output all numbers from 1 to N, replacing all numbers that are multiples of 3 by "*". Sample Input 7 Sample Output 12*45*7 My attempt: using System; using System.Collections.Generic; namespace SoloLearn { class Program { static void Main(string[] args) { int N = Convert.ToInt32(Console.ReadLine()); int x = 1; //your code goes here while(x<=N){ if (N%3==0){ Console.Write("*"); } Console.Write("{0}", x++); } } } }