0
Multiples of 3 C#
I took on the challenge and came up with this: using System; using System.Collections.Generic; namespace SoloLearn { class Program { static void Main(string[] args) { int number = Convert.ToInt32(Console.ReadLine()); int value; //your code goes here while(value < number) { if(value % 3 == 0) { Console.Write("*"); value++; } else { Console.Write(value); value++; } } } } } yet it comes out with an error, can anyone help?
6 odpowiedzi
+ 2
variable value is not initialized
int value = 0; would do
+ 1
had to set it to 1
+ 1
cos othwewise it would do *12*45*7
0
what does that mean
0
o u mean its not set
0
ok