CJCoding With Joseph
← Back to Question List
C# Code Walkthrough #30

Even or Odd With a Ternary

easyOperators

📄 Code

Read carefully — what does this print?
1int x = 10;
2string s = x % 2 == 0 ? "even" : "odd";
3Console.WriteLine(s);

🎯 Your Answer