+ 3
[ANSWERED] Can someone help me with C# project?
This is for the C# loops project. I dont understand whats wrong with my code, please help! int number = Convert.ToInt32(Console.ReadLine()); //your code goes here for (int x = 1;x <= number;x++){ if (x % 3 = 0) { Console.WriteLine("*"); continue; } Console.WriteLine(x); }
3 ответов
+ 2
Sure, you missed second '=' In your if statement. A single '=' sign is used for assignment, while double '==' sign is used for comparisons.
That's what the error said.(that left side for assignment must be a variable)
So this shall work fine:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Sololearn
{
class Program
{
static void Main(string[] args)
{
int number = Convert.ToInt32(Console.ReadLine());
//your code goes here
for (int x = 1;x <= number;x++){
if (x % 3 == 0) {
Console.WriteLine("*");
continue;
}
Console.WriteLine(x);
}
}
}
}
0
Ok thank you!
0
Can somebody help me in introduction to c# module 5 answers?