+ 1

(Solved)Im stuck, at C# lesson 23: multible by 3. Will someone help?

solved 3 first but the remainders 4 and 5 are hidden but failed so I cant even know whats wrong. Kinda frustrating.... code is below https://code.sololearn.com/cef1Av5489K6/?ref=app

19th Jun 2021, 10:52 PM
Hans Agerbo
Hans Agerbo - avatar
3 Réponses
+ 2
The C# task requires the solution to be printed in the same line. Same Line (Correct): 12*45*7 Different Line (Wrong): 1 2 * 4 5 * 7
20th Jun 2021, 5:22 AM
silentlearner
silentlearner - avatar
+ 1
Sorry guys, but it seems to make no difference. Both Write and WriteLine gives me a correct solution for the first 3 attempts. I even tried putting in N value of 1000 and it outputs every 3rd number as *, which is the equivalent as a number multiple by 3. but still the hidden 4th and 5th remain unsolved.
20th Jun 2021, 10:16 AM
Hans Agerbo
Hans Agerbo - avatar
0
Alright. Moving the x definition and setting an end to the for loop solved the rest. For(int x = 1; x <= N; x++) The problem appeared when I entered a 3, 6, 9, 12, 15, 18 etc.. it would run indefinitely. Thanks for the inputs.
20th Jun 2021, 11:06 AM
Hans Agerbo
Hans Agerbo - avatar