+ 1

Help with Multiple of three C#

I have been trying to complete this task for hours but i don’t understand, could someone help me with this

7th Mar 2022, 11:38 AM
Colourblind546
4 Answers
+ 1
I don't know for sure, but maybe the code isn't working because the part where it says "//your code goes here", you don't have any extra code...? edit: I have just reviewed the task. So it's not really what I thought. I think your mistake is your if(x! = x* = 3) line. Look at using the % and I'm sure you'll be fine.
8th Mar 2022, 3:10 AM
Ausgrindtube
Ausgrindtube - avatar
+ 1
That is actually a piece of correct syntax. I didnt think at first either, but turned out okay. It’s a statement and expression in one. Ausgrindtube
8th Mar 2022, 6:50 AM
Brave Tea
Brave Tea - avatar
0
Please show us your code.
7th Mar 2022, 11:40 AM
Brave Tea
Brave Tea - avatar
- 2
using System; using System.Collections.Generic; namespace SoloLearn { class Program { static void Main(string[] args) { int x = 0; int number = Convert.ToInt32(Console.ReadLine()); for (x; x <= number; x++) { if (x != x *= 3) { Console.Write(x); } else { Console.Write("*"); } } //your code goes here } } }
7th Mar 2022, 12:33 PM
Colourblind546