If & Switch Statements (Exercise) – Learn C#

If & Switch Statements (Exercise) – Learn C#

This is an exercise for this YouTube video.

Happy learning and good luck!

You want to compare two variables and based on the result of the comparison, you want to do something.

What statement(s) can you use?


Assignment: Write code which will determine the sign of  a number.



Click to see the answer





Assignment: Make a simple chatbot using switch statement.



Click to see the answer





2 thoughts on “If & Switch Statements (Exercise) – Learn C#

  1. Hi am a fan of your work.I’ll probably be visiting this website like everyday.
    Please could you make a tutorial about arrays.
    And I will also recommend putting a few ads to help your business.

    • Hello! I’m happy that you enjoy my videos!
      Tutorial about arrays is coming up next in the Learn C# course.
      Thanks for the recommendation, but I’m not planning to use this website as a income stream (at least not yet), so I think the “huge” amounts of YouTube money I get is enough 😀

Leave a Comment