I
I
Ivan2019-03-24 07:26:16
C++ / C#
Ivan, 2019-03-24 07:26:16

C# what is the error in the code?

I want to write a c# program that shows the schedule depending on the week (even, odd) and the day of the week (monday tuesday etc)

Console.WriteLine("enter week number");
word1 = Console.ReadLine();
Console.WriteLine("enter the day of the week");
word = Console.ReadLine();

if  ((word1 = "четная") && (word = "понедельник"));
    Console.WriteLine("any way\nany way");

in the line where I wanted to combine two conditions, it gives an error, how can I fix it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2019-03-24
@rainje

word1 = "четная"it's an assignment. word1 == "четная"this is a comparison.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question