Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
The switch/case construct implies that the value passed to the switch will be initially known.
In fact, each case is a constant.
Try to rewrite under if / else and you will immediately understand why this happens.
Your code
int d = Convert.ToInt32(Console.ReadLine());
int g = d % 2;
if (g == 0)
{
for(int s = g; s < 20; s++)
{
if(s) // тут уже не понятно с чем сравнивать вашу s для выполнения условия.
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question